- Home /
Multiple boards
not sure how this is done, been trying all night i have had little success, all i was is a few boards on a window, let say a zombie gets the distance of 2 away from the boards and start ripping off, i was thinking of a waypoint system but i could only do it with one board on the window, i cant seem to make it multiple boards, i tried arrays and all that stuff but im not the best at arrays yet.... also i wanted the board to come off like 2 seconds after each other :/.. here is my code for the one board getting ripped of the window. var startMarker: Transform; var endMarker: Transform; var Going : boolean = false; var speed = 1.0; var Player : Transform; function Update () { var dist : float = Vector3.Distance(transform.position, Player.position); Debug.DrawLine(transform.position, Player.position); if(dist <= 2){ Going = true; } if(Going == true){ transform.position = Vector3(-1.02, -0.76, 3.09); transform.rotation = Quaternion.Lerp (startMarker.rotation, endMarker.rotation,Time.time * 345); } }
Your answer
Follow this Question
Related Questions
Iterating a GO through an array of transform positions 0 Answers
objects in the same array wont move 0 Answers
How to display gameobjects when i pause the game? 1 Answer
Get a GameObject from a component 1 Answer
Problem in placing my array pieces 3 Answers