#It would end up being sqrt 2 2 when you

1 messages · Page 1 of 1 (latest)

iron comet
#

sorry i had to go somewhere can i make this a thread?

#

the vector is already normalized in another script so i dont think that would help

faint eagle
#

The original message seems to be gone, so maybe add context if you expect an answer.

crimson anchor
iron comet
#

sorry im kind of a beginner, what are diagonal vectors, is it just Vector2.(1, 1)

crimson anchor
#

I would personally use Vector2(1,1).normalized for up-right diagonal

But technically it would be Vector2(1,1)* Mathf.Sqrt(2)/2

#

Or Vector2(Mathf.Sqrt(2)/2, Mathf.Sqrt(2)/2)

#

Basically, if you want diagonals, you cant use Vector2.up, .right, etc

iron comet
#

ok, the thing is I'm already normalizing the vectors and the problem is that the arrows aren't being spawned at the right place but the velocity they are launched at is correct

#

i could show you a video of how the cardinal directions work and how the diagonal directions (don't) work and tell you what i want to happen

crimson anchor
#

Hmm

crimson anchor
iron comet
#

yes i have a function called FindOffsetAxis(float offset, Vector2 facingDirection) if the player is facing in a cardinal direction then it returns a Vector2 with the y and x axis flipped( the y value becomes the x value and vice versa) and multiplies them both by the offset which is the degree of randomness

#

ill send you a paste myst of the code