Looking to not include the ground in my racing game to collide and trigger the event for FMOD
I have some code I am using to trigger as sound when colliding with objects in my racing game I am working on, but when the car leans or tilts it is hitting the ground and triggering the event. How would I exclude the ground from being a trigger that starts the event in this script?
2 Replies
id say its impossible to do from here since this only defines the eventhandler after the event has already triggered. You'd want to check how you define collisions and detach the eventhandler for a collision with the ground... unless the collision variable contains some eventargs for what collision triggered the event the only way for you to not respond here is to check whether the relativeVelocity is equal to the current velocity of the car itself? (the relative velocity to the ground at the moment of collision would be equal to current velocity, since it's standing still, but then this also triggers whenever a player is going dubble your speed and hits you so bad case...) I'd check a layer up or send more information with the event.