1
$\begingroup$

I want to know if my vehicle (Vehicle wrapper) collides with the ground. But I can't figure out any method that to check that.

$\endgroup$
2
$\begingroup$

As far as I remember the vehicle wrapper uses rays (along global -Z) to determine wheel collision. The visible wheels are "display only". This means they do not collide with anything.

That is the reason why they can flip through the floor when the vehicle lays on the side.

I'm not familiar with any feedback from the vehicle wrapper telling if a wheel detects the ground.

Possible Solution

I suggest you do a similar thing: Sense with a ray along -Z. The distance should match the wheels radius. When it detects something, you can assume it is ground.

$\endgroup$
  • $\begingroup$ Thank you. That is what i did. (See post under the Lev's answer) $\endgroup$ – Toger Jul 15 '15 at 12:36
2
$\begingroup$

1) Make the vehicle dynamic in the physics tab. And make the ground static. In both of them activate the collision bounds under the same tab. Afterwards press Game --> Show Physics Visualization Now when you press P you are gonna see the collision boxes and when the vehicle drops to touch the ground the vertices that touch it are gonna become yellow.

2)Else add a collision sensor to the vehicle and select the material option and there add the material of the ground. You can just order a python script to print "Touch" everytime the sensor is positive.

3)Else add the same sensor as in (2) and also add a property. When the vehicle touches the ground have the property's value to change and make it visible during play time by activating the (!) next to the property and the Game --> "Show Debug Properties".

$\endgroup$
  • $\begingroup$ Thank you for your answer. I already tried all these methods. But my problem is (probably i should have been mre precise in my question description) that i dont need the Collision of the vehicle body. I need the Collision of the Wheel. As far as i know (and as i did it) thay need to be no collision. And i also don't know how to acces them during runtime because the vehicle wrapper changs them that i cant acces them. Im searching for any trick to get information if the vehicle (wheels) collide or not. $\endgroup$ – Toger Jul 12 '15 at 19:50
  • $\begingroup$ Can you share your blend file through pasteall.org/blend so I can understand better what you want to achieve and where the problem is? $\endgroup$ – Lev Jul 12 '15 at 19:52
  • $\begingroup$ I tried around now. And the best way for me is a ray which points down. This ray checks if there is ground under the car or if the car is jumping. that works okay $\endgroup$ – Toger Jul 12 '15 at 21:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.