- Home /
how whould i make a pushable rock
hello all i was wondering how to make a pushable rock like is there a way to make on trigger enter make the rock to enter as a child with the player prefab iv had a lot of trouble looking around for somthing like this and i really needed it.
thanks in advance :)
Answer by Meltdown · Mar 18, 2011 at 09:29 AM
Make sure your rock has a RigidBody component attached to it. Then when your player collides with the rock, simply add the force of the player, to the rock using RigidBody.AddForce
http://unity3d.com/support/documentation/ScriptReference/Rigidbody.AddForce.html
Your answer
![](https://koobas.hobune.stream/wayback/20220613113520im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Rigidbody triggers are pushing a CharacterController.. 3 Answers
how to end your game 1 Answer
Sound help with script 1 Answer
Make Character Fall 2 Answers
Push object out of another 0 Answers