- Home /
Object rotation from web page values
Hello, I'm completely new to unity/programing and could use some help.
I want to set the position of an object based on two different values calculated from a web page. I've been able to get the values into unity but I'm not sure where to go from here. When the values are calculated, the object should rotate by that amount and stay there until values are calculated again.
Here's what I've got so far
private var messages : String = ""; private var azimuthValue : float = -1; private var altitudeValue : float = -1;
function receiveAzimuth(msg:String ){ azimuthValue = parseFloat(msg); }
function receiveAltitude(msg:String ){ altitudeValue = parseFloat(msg); messages = "azimuth: [" + azimuthValue + "]\naltitude: [" + altitudeValue + "]\n"; }
function Update () { transform.RotateAround(Vector3(0,0,0),Vector3(1,0,0),azimuthValue); transform.RotateAround(Vector3(0,0,0),Vector3(0,1,0),altitudeValue); }
Answer by Eric5h5 · Apr 04, 2010 at 04:15 PM
Take the RotateAround statements out of Update and put them in the appropriate functions.
Your answer
Follow this Question
Related Questions
How to make two rays with different offset follow objects rotation? 1 Answer
How do I rotate a circle of objects so that a specific object is in front of the camera? 2 Answers
rotation of the object to a given angle 1 Answer
How to make an enemy that walks around a platform? 0 Answers
turning a project using AddTorque 0 Answers