Question by
NurulAini95 · Oct 01, 2015 at 10:14 AM ·
moving-animationsballoon
hai. I would like to know if i can make my balloon float in unity using this coding ?because there are error.urgent...
using UnityEngine;
using System.Collections;
public class bb : MonoBehaviour {
// Use this for initialization void Start () {
}
// Update is called once per frame void Update () {
IEnumerator moveFunction() { float timeSinceStarted = 0ff; while (true) { timeSinceStarted += Time.DeltaTime; obj.transform.position = B.Lerp(obj.transform.position, newPosition, timeSinceStarted);
// If the object has arrived, stop the coroutine
if (obj.transform.position == newPosition)
{
yield break;
}
// Otherwise, continue next frame
yield return null;
}
}
capture.jpg
(50.7 kB)
Comment
Your answer
Follow this Question
Related Questions
script movement unity 2d 2 Answers
Movement Keys for FPS WASD and Space keys not working 1 Answer
Problems with enemies and animations 0 Answers
How to make a sphere animate and move from one platform tile to another ? 2 Answers
Make a "Balloon" that floats upwards but slows as it gets higher 1 Answer