Just so happens I’ve been working with vectors a lot recently. I might be able to help you but no guarantees here.
Ok so you said that you just wanted to change the direction with the velocity value of the rocket but NOT change the speed?
My apologies but I didn’t perfectly understand what you wanted so I’m just gonna guess here.
So sit down, grab some popcorn, get a soda, and let me learn you about some vectors.
So essentially a vector is made up of two parts. A Direction and A Magnitude
The magnitude is the “speed” at which the object is moving.
The direction is… fill in the blank.
If you wanted to use JUST the direction, I would recommend
.normalized
or Normalize()
depending on the context. What this does is essentially set the vector’s magnitude to 1 while maintaining its direction.
With its magnitude at one, you can multiply any speed value to that velocity and that will become its new magnitude.
On a side note, here’s what vector math looks like.
![1]
At the end of the first vector, start to draw the second vector. The green vector is the new sum of the two. Notice how much larger the magnitude is and how the direction resembles neither of the original two.
The new direction is always a compromise between the two original vectors. The first vector was in Quadrant I while the second vector is in Quadrant IV. The resulting vector was directly in between QI and QIV.
The new magnitude will be greater based on how similar the directions are. In the example, the new magnitude could be larger if the directions of a and b were the same. Conversely, the new magnitude could be shorter if the directions of a and b were completely opposite (b would be overlapping a because it would be moving backwards on top of a thus shrinking the magnitude).
Maybe doodle on some paper and try to experiment with this so you can get a feel for how they work.
Well, hopefully you learned something today. Let me know if you need more help.