tommerbob
Minecraft. :D
- Reaction score
- 110
I think I'm just gonna create a thread for all of my math questions I ever have in the future. I should pay more attention in math class.
So here's my problem:
I'm trying to launch a projectile in a random direction from the point of origin:
(I'm using Kenny's Projectile system)
I thought the angle here:
should be random, but its not. The projectile is always going in the same direction.
Thanks for help.
So here's my problem:
I'm trying to launch a projectile in a random direction from the point of origin:
JASS:
local projectile p = 0
local real ux = GetUnitX(d.orb)
local real uy = GetUnitY(d.orb)
local real tx = GetRandomReal(0, 360)
local real ty = GetRandomReal(0, 360)
set p = projectile.create(ux,uy,50.00,Atan2((ty - uy),(tx - ux)))
(I'm using Kenny's Projectile system)
I thought the angle here:
JASS:
Atan2((ty - uy),(tx - ux))
should be random, but its not. The projectile is always going in the same direction.
Thanks for help.