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.