Math in Hytale: Vector normalization

Forum Rewards
Every new forum post gives the author +10 coins. You can also reward great posts from other users.
Min donation: 10 coins Author gets 50%
I'm writing a script for a homing fireball. Pro tip: always normalize your direction vectors before multiplying by the speed variable. If you don't, the fireball will accelerate exponentially as it gets further from the origin!
Good old vector math. Are you using the built-in 'Vector3' class or writing your own? I heard the built-in one has some nice lerping functions.
The built-in library is surprisingly robust. It handles most of the heavy lifting for you. Just watch out for floating point errors on long-range projectiles.

Post a Reply

Formatting: [b]bold[/b], [i]italic[/i], [u]underline[/u], [code]code[/code], [quote]quote[/quote]