Hello
I have a gameobject that I want to move to various position in scene like a pinball.
The GameObject is a balloon and I want to move left, right, top and down randomly in scene.
How can I do this ?
Hello
I have a gameobject that I want to move to various position in scene like a pinball.
The GameObject is a balloon and I want to move left, right, top and down randomly in scene.
How can I do this ?
Obviously, start by creating a script.
You can change position of an object by performing:
private Vector3 moveVector;
void Update(){
moveVector = Vector3.up;
transform.Translate(moveVector*Time.deltaTime);
}
where by “moveVector = Vector3.up” you set where to move.