Hey guys, Ethaninja here, on my hands and knees again, begging for mercy and clarification!
So, basically, I’m creating a hoverboard game right, and well of course my hoverboard needs to hover. Now just for a bit of elaboration; I want the board to hover ever so slightly up and down when not moving. If you catch my drift
Hopefully you get what I am trying to achieve by me telling you or showing you my code
The problem is, it just moves up once, and doesn’t come back down again. Also, it does it instantly, not smoothly.
Now, this is sort of what I was going for:
/*
Name: hoverScript.cs
Author: Ethan Roberts
Description:
This script is for use in conjuncture with all hoverboards.
It's purpose is for a simple "idle hover" behaviour
*/
using UnityEngine;
using System.Collections;
public class hoverScript : MonoBehaviour {
bool bHover = true;
float fOrigin = 0.0f;
float fPosHeight = 2.0f;
void Start () {
if (fOrigin == fOrigin){
transform.Translate (0, fPosHeight,0);
}
if(fOrigin >= fPosHeight){
transform.Translate (0, fOrigin,0);
}
}
void Update () {
}
}
Before you start shouting at me and spanking me, I must remind you all that I AM a giant n00bzor, so I’m probably going in the wrong direction with this xD