DerRidda Posted April 6, 2015 Share Posted April 6, 2015 I have a bit of a problem here. I need to have a physical barrier behind which entities can be used by the default FPSController. I created a thin barrier with scene collision, applied the invisible.mat and attached a script that basically only does self.entity:SetPickMode(0), in the hopes that that would be enough to accomplish my goals. Well, if it did I wouldn't have to write this... The hand doesn't show up and I can't use the objects behind it. The distance is well within the limits and I have tried changing the "closest" flag in the picks itself to false, which worked but only on some of the objects behind the barrier, others still wouldn't show up/be usable. Any help would be appreciated. Quote Link to comment Share on other sites More sharing options...
Rick Posted April 6, 2015 Share Posted April 6, 2015 I need to have a physical barrier behind which entities can be used by the default FPSController. Can you explain why you need this? What are you trying to accomplish? Quote Link to comment Share on other sites More sharing options...
DerRidda Posted April 6, 2015 Author Share Posted April 6, 2015 Big, player sized sliding puzzle. I basically have a portion of the floor carved out for this and if the player stands in the empty slot in which the blocks should go they either just block the movement, get squished or telefragged depending on how I set up the movement of the blocks. So I just don't want the player in the gap but that gap could be anywhere depending on the state of the puzzle. Quote Link to comment Share on other sites More sharing options...
Rick Posted April 6, 2015 Share Posted April 6, 2015 How does that relate to your need to NOT have the icon or interaction show up? Either way, I feel like you'd be better off having a flag in the FPSPlayer script that skips these pickings when certain conditions are met and resumes them (if you need that) when other conditions are met. Quote Link to comment Share on other sites More sharing options...
DerRidda Posted April 6, 2015 Author Share Posted April 6, 2015 Huh? Was I that unclear? I need the hand to show up and use the items behind the barrier but apparently my barrier is still being picked even though I set self.entity:SetPickMode(0) which should mean that this entity is ignored in pick tests according to this: http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/entity/entitysetpickmode-r135 Quote Link to comment Share on other sites More sharing options...
Rick Posted April 6, 2015 Share Posted April 6, 2015 Did you set this barrier's collision to None? I think that may be different than the pick mode? Quote Link to comment Share on other sites More sharing options...
DerRidda Posted April 6, 2015 Author Share Posted April 6, 2015 Well, that would make the whole barrier useless but yes, I tried and it is independent from the pickmode, as I fall through it but it still manages to block the pick. Here's the project: https://drive.google.com/file/d/0B3jPhxJap2Y3V05iMlRjYmVSWTQ/view?usp=sharing It's as close to desired behavior as I could get it by changing the "closest" parameter in the picks inside FPSPlayer.lua to false. The left and right columns can be used (good) while the center one still can't (bad). I hope this clearly shows what I'm trying to accomplish. Quote Link to comment Share on other sites More sharing options...
Rick Posted April 6, 2015 Share Posted April 6, 2015 Yes, sorry. Playing with the collision type would be the way to do it. You want a collision type that collides with the character but doesn't collide with whatever collision type is used in the raycasting. I don't recall what the FPSPlayer.lua file uses as a collision type for the ray, but looking in the docs should show what collision type you can put this barrier to, to give character collision but no collision with the ray. Or you can make your own type as well that does this. Don't recall that off the top of my head but if you do a search here for custom collision type something should come up around that. Ultimately I believe this is all about collision type of the barrier. Quote Link to comment Share on other sites More sharing options...
DerRidda Posted April 6, 2015 Author Share Posted April 6, 2015 You are right, setting the collision type of the actual pick to Collision.Scene (which equals 2) did the trick as scene does not collide with scene but still collides with prop. Though I'm surprised that SetPickMode(0) didn't work in a way that basically means "No matter my collision type or how you pick, I will be ignored." I probably misunderstand what this actually does. Thanks for the help. Quote Link to comment Share on other sites More sharing options...
macklebee Posted April 6, 2015 Share Posted April 6, 2015 Setting collisiontype to '0' on entities means no collision whereas setting the collisiontype on a raycast to '0' means it will report a collision with everything. Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.