playMaker

Author Topic: Game object is grounded [SOLVED]  (Read 2461 times)

tim.holman

  • 1.2 Beta
  • Playmaker Newbie
  • *
  • Posts: 49
    • View Profile
Game object is grounded [SOLVED]
« on: February 23, 2012, 09:49:28 AM »
I'm looking for a way to decipher whether or not a game object (golf ball) is currently on the ground. Basically, I need the "ControllerIsGrounded" boolean check, except I need to use it for a game object, and not the character controller. Does anybody know of a good way to do this? Any help would be appreciated!
« Last Edit: February 29, 2012, 11:05:43 AM by Alex Chouls »

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3634
  • Official Playmaker Support
    • View Profile
    • LinkedIn
Re: Game object is grounded
« Reply #1 on: February 23, 2012, 01:57:13 PM »
You could use COLLISION ENTER event to set a boolean variable true, then COLLISION EXIT event to set it false. Or use the Collision Event action if you need to specify Tags.

Also if the ball has a Rigid Body you can use Get Speed to test if the ball has stopped moving.

tim.holman

  • 1.2 Beta
  • Playmaker Newbie
  • *
  • Posts: 49
    • View Profile
Re: Game object is grounded
« Reply #2 on: February 28, 2012, 10:40:13 AM »
Thanks Alex, I ended up just setting up an fsm to check grounded based on collision enter/ exit. Seems to work good. Much appreciated!