Hello there, thx in advance.
I am working on a 3D game.
The intend: I want a Ball that is not affected by gravity but can still be manipulated by velocity(rigidbody). This ball is in a closed off room, but should bounce off the walls. If the ball hits a moving object, the moving objects velocity gets applied to the ball, there by increasing or decreasing its speed. This is why i don’t think it can work when its kinematic.
The problem: The ball can float in air quite welll, and i can move it at a speed using in FixedUpdate:
this.rigidbody.velocity = this.rigidbody.velocity.normalized * Time.deltaTime * 100.0f; rigidbody.AddRelativeForce(100.0f * this.transform.forward);
But the ball just goes into an instant stop when hitting a wall, even though i should reflect its movement:
this code is triggered OnCollisionEnter,
this.rigidbody.velocity = Vector3.Reflect(this.rigidbody.velocity, contact.normal);
Can someone please explain what i am doing wrong?