- Home /
Pong: Paddle rigidbody, handling collision
Hi, I'm new to unity. I have a question about how to deal with the paddle movement. I want it so that the ball bounces off the paddle without moving the paddle and the paddle not flying off when it hits the edges. I've read that i should set iskinematic to true, but then i cant move it using addforce... What i currently have is a paddle with really high mass such that the ball doesn't push it. I've tried making iskinematic true for onCollisionEnter and false for onCollisionExit when colliding with a wall but it still moves and turns slightly... Ideally I'd like it to remain straight and just bounce off the wall
Answer by phxvyper · Mar 24, 2017 at 10:19 PM
Enable isKinematic, and move the Rigidbody using Velocity rather than Force.
When the ball collides with the paddle, have your ball's script get the normal for the collision and set its velocity in that direction.
Typically you'd only keep isKinematic off if you want realistic movement and physics (like world props). But something like Pong shouldnt require any physics simulation.
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
How do I control the speed of a rotating rigidbody? 0 Answers
Rotate player (rigidbody) towards his movement 2 Answers
Why wont my character jump? (using rigidbody and addForce) 1 Answer