- Home /
Falling object passes through ground objects - Need help
I have an object that needs to hit and move across blocks when it lands on top of them. But currently it just falls through them and I'm unable to figure out a system to keep it on top of the blocks.
Here is the setup of blocks:
I have five collision boxes assigned as children of the parent object.
And within the inspector here are the settings for the rigid bodies attached to said collision boxes:
The object that I want to land on top of the blocks is this:
Here is the inspector for the prefab_pickup_mushroomGrow:
And here is the inspector for the mushroomCollider:
Once again the expected behavior is for the object to land on top of the blocks without passing through. Any suggestions for a system to achieve this are appreciated.
Some additional information: - The mushroom object DOES pass through the blocks as evidenced by print functions placed inside the OnTriggerEnter event.
Answer by xortrox · Apr 22, 2014 at 09:01 PM
Its collider is set to trigger, which means it is meant to pass through other colliders to "trigger" the OnTriggerEnter/Stay/Leave functions, you might want to use Vector3.Distance to calculate the distance between the pickups and your player object for the pickup instead of collisions and change the pickups to not be triggers.