- Home /
pushing object
It works but for some reason, it did not. And I want to know the numbers in vector3 that an object can be pushed anywhere in the direction. Here is PNG.
Answer by Vipertex13 · Apr 09, 2020 at 03:57 AM
Hello!
To push an object, add a rigid body to the object and make the mass to 1 and put the mass of the player to like 100 then the object will be pushed by the player
Changing the physic material of the floor worked better for me. Setting Dynamic and Static Friction to 0.1 and setting Friction Combine to multiply works good even if the mass of the player is the same as object's.
Answer by azerty0220pl · Apr 09, 2020 at 10:25 AM
Hello @GraceBelt123! If you want to use the script, I would try something like this: GetComponent<Rigidbody>().AddForce(player.transform.forward * x);
This will add a force in the direction the "player" GameObject is looking. "x" is a float, which will allow you to adjust the force you want to add.
Your answer
Follow this Question
Related Questions
How to detect player collision 0 Answers
How to make a 2D "trampoline"? 2 Answers
OnControllerColliderHit function is not called if player is not performing a move. 2 Answers
Tree Collider 4 Answers
clone functions 2 Answers