I’m attempting to implement a mechanic into an isometric game that spawns rocks above the player that will fall on them and cause damage. I’ve gotten the rocks to spawn and cause damage but how can I keep them from causing damage after they’ve landed on the floor and are rolling around? I’ve attempted setting up a bool for “IsFalling?” set to true when they’re spawned and have tried using an Event Hit to set the bool false if the object hits anything other than the player but it’s not registering when it hits the floor.
You can approach this in a variety of ways, and you may need to experiment with different approaches and fine-tune the conditions that trigger the “IsFalling” flag to be set to false.
- You can check the velocity of the rock after it has landed to see if it’s still moving. If it’s not, you can assume that it has come to a stop and set the “IsFalling” flag to false.
- Use a timer to determine when the rock has landed. For example, you could start a timer when the rock is spawned and set the “IsFalling” flag to false when the timer expires.
- Check the angle of the rock after it has landed. If the angle is below a certain threshold, you can assume that it has come to a stop and set the “IsFalling” flag to false.
- Use a separate physics volume to represent the floor, and use an overlap event or collision event to detect when the rock has landed.
1 Like