Object changes place in game
Hi,
When I place an object in the scene and I press play to play the game, the object changed place. I dont't know why that is. I also added a code that they can move up and down. Sometimes they change place and sometimes not... .
Here are some screenshots:
and here is the code for moving them:
float originalY;
public float floatStrength = 1;
void Start()
{
this.originalY = this.transform.position.y;
}
void Update()
{
transform.position = new Vector3(transform.position.x,
originalY + ((float)Math.Sin(Time.time) * floatStrength),
transform.position.z);
}
can someone help me with this? Thank you in advance Cynni
Comment
Your answer
Follow this Question
Related Questions
Moving forward based off of Rotation 3 Answers
Changing a variable value 2 Answers
Speedtree trees each have a little white ball that is undeletable (!) 1 Answer
I'm having problems instaniating 0 Answers