playMaker

Author Topic: Get Bounding Boxes and check the distance. [SOLVED]  (Read 4055 times)

KirbyRawr

  • Playmaker Newbie
  • *
  • Posts: 16
    • Overflowing Team
Get Bounding Boxes and check the distance. [SOLVED]
« on: November 10, 2013, 06:05:21 AM »
Hi, i'm having problems with my playet, i want him to crouch but not when he's viewing a wall, i did it, but it only works with pivot point of the gameobject, so i need to get the distance from gameobject to Bounding box.
Also if it's possible check the angle to the bounding box.
Thanks in advanced.
« Last Edit: November 11, 2013, 12:37:03 AM by jeanfabre »

jpsmarinho

  • Playmaker Newbie
  • *
  • Posts: 11
Re: Get Bounding Boxes and check the distance.
« Reply #1 on: November 10, 2013, 08:59:22 AM »
For the distance you have the Get Distance action.

KirbyRawr

  • Playmaker Newbie
  • *
  • Posts: 16
    • Overflowing Team
Re: Get Bounding Boxes and check the distance.
« Reply #2 on: November 10, 2013, 09:25:18 AM »
For the distance you have the Get Distance action.
Yes but it works with the pivot point of the GameObject instead of the surface of the bounding box :)

mikejkelley

  • Full Member
  • ***
  • Posts: 136
Re: Get Bounding Boxes and check the distance.
« Reply #3 on: November 10, 2013, 01:38:58 PM »
By bounding box do you mean like the Character Collider/Controller? If so you can drag those scripts from the inspector to the state and select get/set property. Determining a point on the surface will require math using surface and center properties.

Otherwise, just put an empty object at the surface of your bounding box and use that to determine distance. Nobody will know/care it's not an "elegant"  solution.

KirbyRawr

  • Playmaker Newbie
  • *
  • Posts: 16
    • Overflowing Team
Re: Get Bounding Boxes and check the distance.
« Reply #4 on: November 10, 2013, 06:24:34 PM »
By bounding box do you mean like the Character Collider/Controller? If so you can drag those scripts from the inspector to the state and select get/set property. Determining a point on the surface will require math using surface and center properties.

Otherwise, just put an empty object at the surface of your bounding box and use that to determine distance. Nobody will know/care it's not an "elegant"  solution.
Thanks, i got it working in other form, i just put another collider with trigger, and check if it's triggering or not, this is the best solution and very precise i did.
The bounds aren't precise for me because i was doing them wrong, but thanks :)