Hi there I currently have a touch system where when one taps anywhere on the screen, that position, subtracted by the players position (in 2D) is the rise and run. It decides from that then the tangent, or direction for a bullet to fire. This is fine and I have it working fine, however, the issue I have is…
example.
playerPosition = 0, 0
tapPosition = 1, 1
If I tap like so, this will create a bullet, (currently using rigidbody but open to any type of component for movement) and it will travel in the direction of x @ 1 * speed and y @ 1 speed.
The problem is if I tap again at say…
playerPosition = 0, 0
tapPositon = 3, 3
again the bullet travels at 3 * speed and 3 * speed.
How can I make an object of class bullet have a consistent speed given the method I am using to obtain its travel direction? I am currently reluctant to use a characterControl because as I say, these are for bullets and as such if I shoot 3 dozen bullets and my update is not responsible for moving 3 dozen objects per update… seems a bit daunting.
Anyone have any suggestions to get object’s of bullet class to move at a consistent speed given how I am instructing their direction?
*elements I have to determine direction
rise
run
angle