0
votes

I have been creating a physics Model Newton Cradle(pendulum) in Unity 3D, but have been facing difficulties in rotating and zooming camera around object, applying momentum conservation for pendulum objects.

1
So your question is? That's more of a statement isn't it? - slumtrimpet
You're going to need to include more details about your exact implementation, the problems you're facing, and what you intend to achieve. Otherwise, it's nigh impossible for us to assist you. - Serlite
I want someone to explain me the c# or javascript code that can help to rotate and zoom the camera around object. - Honey Thakuria

1 Answers

0
votes

I'm not sure if this will help but based on the title of this statement[?] I'm guessing you want to rotate the camera around a target. This is some simple code that may help you on your way.

target=GameObject.FindWithTag("Cradle").transform;
transform.LookAt(target);
transform.Translate(Vector3.right * Time.deltaTime*2);

edit the number after deltaTime to change the speed and the Vector 3 for the translation. Obviously change "cradle" to whatever the tag of object you want the camera to focus on.