- Home /
Restrict Y axis
Hi Guys,
I have 2 cylinders. i add a force to cylinder1 on mouse click. When this cylinder1 hits cylinder2 it first hits cylinder2 and cylinder2 jumps in y direction, meanwhile cylinder1 gets past below this cylinder2.
Whereas i want it to collide cylinder2 and then cylinder2 should move according to the hit direction but should never move in y direction(jump)
Plz help
$$anonymous$$ore info please, can you post any code? Are you trying to do this just with physics or is it a script?
I am only adding force. No transform modifications via scripts...
Ex: There are 2 pucks(air hockey). I added force to puck1 and when puck1 hits to puck2.. puck2 jumps a bit in y(no rotation) and puck1 goes through from below it... plz help
well, then maybe this is youre problem. depending on how youre model is colliding with the other cillinder, it really should jump. if you want a specific behaviour you need to code it down. maybe adding mass to the second cylinder helps, but you should explain better your situation, with screenshots and codes if possible.
What about just letting the physics do its thing, but using a script to force the Y position to 0 each frame?