playMaker

Author Topic: Best way to change character collider size without intersection?  (Read 1872 times)

Adam Z

  • Full Member
  • ***
  • Posts: 207
I have a State called crouch in which it changes the collider height with a Set Property.  The problem Im having is that when I'm crouching under and object and then I un-crouch (the collider height changes to the normal size), the object and player colliders overlap. What would be a good way to only let the collider change size (or change state to standing) if two colliders don't intersect?

Thanks.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Best way to change character collider size without intersection?
« Reply #1 on: October 26, 2015, 03:34:06 PM »
Hi,
maybe you could try setting 2 colliders and when crouching set the top collider as trigger and let it check if it is overlapping when uncrouching.
then use a on trigger exit on it so when not any more under the object it can let the player stand and uncheck trigger again.

if you don't understand what i mean i will make a sample video of what i mean :)
just let me know

Adam Z

  • Full Member
  • ***
  • Posts: 207
Re: Best way to change character collider size without intersection?
« Reply #2 on: October 26, 2015, 04:23:03 PM »
Is it possible to do it with a raycast on the y-axis?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Best way to change character collider size without intersection?
« Reply #3 on: October 26, 2015, 04:52:32 PM »
Hi,
yes that is possible
but you might want to use Raycast2 (Custom Action)
you can get it on the EcoSystem