Answer the question
In order to leave comments, you need to log in
Why doesn't object repulsion work?
Hello, there is a player and an object that should be repelled if the player touches it. It seems that everything was logically done, but when it touches, the object does not repel from the player. Now the script looks like this:
public Rigidbody rb;
void Start()
{
rb = GetComponent();
}
void OnCollisionEnter(Collision collision)
{
rb.AddForce(0f, 0f, 15);
}
Tried to do and through the trigger, all the same it is impossible.
Player
Inspector: Object Inspector:
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question