- Home /
Prevent paddle from going through walls.
I have a paddle and it keeps going through a wall and it is not supposed to. How can i prevent it to stop going through? Please Provide the full code.
The paddle is called paddle and wall is called wall.
Answer by Kiloblargh · Feb 28, 2013 at 07:31 PM
Use the layer collision mask in project settings/ physics . Make sure they have colliders. or put a configurablejoint on the paddle to limit the range of movement (better idea.) no code needed either way.
what would i do in the settings for the configurable joint
I don't know; you didn't really give enough info on your problem. So I have to assume you're trying to make a physics-based Pong clone. But you can set one of the X, Y, or Z axes to 'limited' and the other 2 to 'locked,' and set the 'linear limit' to whatever the width is where it can move freely.
sorry about the info. I have a paddle and a floor and the paddle is going through the floor. What would the setting be for that?
go to its rigidbody, uncheck gravity, lock movement on Y.
still no luck. I have the paddles rigid body on lock position. I have a configurable joint and under secondary axis everything is locked except y motion and angular y motion are limited. What am I doing wrong?
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
What is wrong with this collision script? 0 Answers
UnityEngine.Input.GetMouseButton(1)) issue 1 Answer
I made a better shader how do i fix[add _Shadow Strength]help???>Sorry that im asking for to much 1 Answer
Help In Making a SphereCast for 3D Tire! Working RayCast Script included! 0 Answers