Hi I’m working on something that’s placing waypoints but I have a issue with using Quaternion.Euler. I’m setting positions of way points and using the direction from the first point then rotating them after.
I set the inital direction as forward since that’s the direction I want to create the way points in
Then I get the value (0, -0.8, 0.6) and getting a value on the Y axis instead of the X axis, I’m just wondering if I’m doing in wrong? When I switch the x and y values it works correct but it shouldn’t be the case.
I’m just trying to add the next way point at a 50.degree angle based on the previous waypoint here’s my code
This is just where I add the first control point and note the direction I want to spawn them in
nextDirection = Vector3.forward; // direction I want to create way points in
AddControlPoint(Vector3.zero); // my method for adding control points
Vector3 lastpos = ControlPoints[ControlPoints.Count - 1].localPosition;
nextDirection = Quaternion.Euler(50, 0, 0) * nextDirection;
new Vector3 nextPos = lastpos + nextDirection * controlPointDistance;// controlPointDistance is used for the distance between control points