playMaker

Author Topic: Avoid trigger box when falling [SOLVED]  (Read 2921 times)

coxy17

  • Beta Group
  • Sr. Member
  • *
  • Posts: 355
Avoid trigger box when falling [SOLVED]
« 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
« Last Edit: March 02, 2014, 11:32:12 AM by coxy17 »

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Avoid trigger box when falling
« Reply #1 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.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

coxy17

  • Beta Group
  • Sr. Member
  • *
  • Posts: 355
Re: Avoid trigger box when falling
« Reply #2 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
« Last Edit: February 26, 2014, 12:05:30 PM by coxy17 »

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Avoid trigger box when falling
« Reply #3 on: February 26, 2014, 12:21:56 PM »
Hmm, not sure I follow.

Are you changing the Is Trigger value on the collider?
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

xhidnoda

  • Full Member
  • ***
  • Posts: 231
Re: Avoid trigger box when falling
« Reply #4 on: February 26, 2014, 12:32:22 PM »
Try to use... onTriggerExit to set disable the the trigger or FSM.
If is this case. (?)

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Avoid trigger box when falling
« Reply #5 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

coxy17

  • Beta Group
  • Sr. Member
  • *
  • Posts: 355
Re: Avoid trigger box when falling
« Reply #6 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


Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Avoid trigger box when falling
« Reply #7 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.
« Last Edit: February 27, 2014, 09:16:35 AM by Lane »
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

coxy17

  • Beta Group
  • Sr. Member
  • *
  • Posts: 355
Re: Avoid trigger box when falling
« Reply #8 on: February 27, 2014, 09:49:26 AM »
Ive drawn a diagram to explain more. The problem is at step 4
« Last Edit: February 27, 2014, 10:48:17 AM by coxy17 »

coxy17

  • Beta Group
  • Sr. Member
  • *
  • Posts: 355
Re: Avoid trigger box when falling
« Reply #9 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.