- Home /
simple pendulum motion working not properly?
Hi All,
http://answers.unity3d.com/questions/415996/motion-script-for-simple-pendulum.html to this link i developed link please take a look. https://www.dropbox.com/s/0hl21ek1ccu48q0/Pendulum.unitypackage
motion code i wrote:
using UnityEngine; using System.Collections;
public class Motion : MonoBehaviour {
public float angle2,Stripe2;
public float speed = 0.5f;
public float angle3;
private float fTimer = 0.0f;
private Vector3 v3T = Vector3.zero;
public Transform pivot;
// Update is called once per frame
void Update () {
Stripe2=GUIMenu.StripeValue;
angle2=Pendulum1.angle+90; angle3=Pendulum1.angle; Debug.Log(Stripe2+" "+angle2); float f = (Mathf.Sin (fTimer * speed - Mathf.PI / 2.0f) + 1.0f) / 2.0f ;
v3T.Set (0.0f, 0.0f, Mathf.Lerp(angle3, -angle3, f)); pivot.eulerAngles = v3T; fTimer += Time.deltaTime; }
}
but that code not working properly. Please take a look. please help.
Your answer
Follow this Question
Related Questions
Is there a way to create motion blur in standard unity 1 Answer
3DS Max biped model bip animations to unity 1 Answer
Motion working not properly in simple pendulum 1 Answer
Collision of a constantly moving object 0 Answers
How can I create contrail effect of a Specific character or object in motion? 1 Answer