PLAYER SCRIPT
SCRIPT NEEDS TO ACCOMPLISH...
Variable to Store target destination
method to instruct player to move to the target destination IF the distance is greater than 1.0f Method needs to... ---> calculate distance ---> calculate direction ---> update destination through script communication with the pointer script
LINE 3-14 --> Logic placed within the update method to constantly determine the distance from the targetDistance (sent from the pointer script) from the user's position
LINE 5 --> creates a variable to store the distance between the targetDestination and the user's position using Vector3.Distance
LINE 7-13 --> an if statement to define functionality if the distance is greater than 1.0f
LINE 9 --> creates a variable to store the direction of the targetDistance
LINE 10 --> sets the length of the vector to 1 using the method Normalize()
LINE 16-20 --> a method that takes in a Vector3 parameter to define the targetDestination
LINE 18 --> locks the y value @ the value necessary for the gameobject to seamlessly move across the floor
Last updated