简体   繁体   中英

2D Pendulum Like movement in unity 3D

I am new to unity3D and I'm working on this game in which i need to get the object move in pendulum motion. When object1 got hit by object2 then object1 should move in pendulum motion.

Please tell me which physics components are required and how should i code this in javascript?

In order to get this kind of behaviour, you'll need to use Joints . There are many types, each with their own purpose. For more information, you can find a rather helpful video detailing joints here and even more info using the official documentation here

edit I should also note that you can use most of these in 2D as well, by adding "2D" to the end of the variable type / method definitions.

Hope this helps!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM