Jump to content

Physical barrier through which default FPSPlayer can pick/use.


DerRidda
 Share

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...