Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: coxy17 on February 26, 2014, 04:23:39 AM

Title: Avoid trigger box when falling [SOLVED]
Post by: coxy17 on February 26, 2014, 04:23:39 AM
Hi, I have a basic jump action. Ive attached a screenshot of a diagram.

step 1: On the diagram the player jumps and jumps above the trigger.
step 2: The player falls and raycasts down to know when it touches the floor

the problem is that the player thinks its touched the ground when it hits the 'trigger'. Causing the player to bounce off. How can i avoid this? ignore the trigger all together.

Thanks

Nick
Title: Re: Avoid trigger box when falling
Post by: Lane on February 26, 2014, 09:27:16 AM
What is the trigger for? Are you using the trigger to tell it that it is grounded? If you are then its a matter of making the box shorter. If you are using a raycast to look for the ground then you might just check to see if the trigger is actually set to "is trigger", the ray length is short enough, and that the ray layer mask is set so that it wouldn't be intersecting with something other than the floor.
Title: Re: Avoid trigger box when falling
Post by: coxy17 on February 26, 2014, 12:02:29 PM
Hi Lane,

The trigger has several actions it in for the player when it enters from 4 sides.

So by jumping, i disable the trigger so the player dont interact with it. But once the player has left the trigger it then re-enables the trigger.

hope it makes sense.

nick



Nick
Title: Re: Avoid trigger box when falling
Post by: Lane on February 26, 2014, 12:21:56 PM
Hmm, not sure I follow.

Are you changing the Is Trigger value on the collider?
Title: Re: Avoid trigger box when falling
Post by: xhidnoda on February 26, 2014, 12:32:22 PM
Try to use... onTriggerExit to set disable the the trigger or FSM.
If is this case. (?)
Title: Re: Avoid trigger box when falling
Post by: jeanfabre on February 26, 2014, 01:45:52 PM
Hi,

 insert a small collider beneath your collider and when the user jumps it will first trigger this and so you can turn your character collider oss during the jump and turn it back on when it starts falling again, then you can jump up platform from beneath.

bye,

 Jean
Title: Re: Avoid trigger box when falling
Post by: coxy17 on February 27, 2014, 09:04:19 AM
Hi,

I think i need to explain more.

1. Current Player Trigger Action
a. Player enters the trigger (OnTriggerEnter)
b. Does action and disables the trigger
c. Player exits trigger and re-enables it (OnTriggerExit)

2. Jump Action
a. Player jumps
b. Player raycasts on return to see when it touches the floor

Now, when the player jumps (number 2), it leaves the trigger (OnTriggerExit). The problem is when the player is falling down, it hits the trigger first. But i need the trigger to be active still for my 'Current Player Trigger Action'. So this leaves me with a problem.

@JeanFabre how do i turn off the box collider from a state? can i do it by a tag?

Hope this helps

Nick

Title: Re: Avoid trigger box when falling
Post by: Lane on February 27, 2014, 09:13:54 AM
I don't understand what you're trying to accomplish here. Why is it a problem when the player is falling he enters the trigger before hitting the floor? The only way i can think of is if it were a collider and he landed on top of it, but its a trigger so this is a non-issue.

Since you're using a raycast for grounded detection, the trigger isn't being used for that so what purpose does it serve that would be inhibited by the player entering/exiting it when jumping?

Are you making platforms that you want to allow him to be jumping onto from below them? (pass through from below only?) If so, maybe you can use the raycast to identify the object below him, then send a message to that collider to be in an "activated" state.
Title: Re: Avoid trigger box when falling
Post by: coxy17 on February 27, 2014, 09:49:26 AM
Ive drawn a diagram to explain more. The problem is at step 4
Title: Re: Avoid trigger box when falling
Post by: coxy17 on March 02, 2014, 11:31:50 AM
It ok now guys, figured it out. I just setup the floor to use its own layer. Then told the raycast to only find the layer using the filter property.