aligning one object with another

Blitz3D Forums/Blitz3D Programming/aligning one object with another

ryan scott(Posted 2004) [#1]
i have a turret on top of a car, how to i align another object with the direction it is facing to make it seem like it's coming out of the turret?

i've got this

RotateEntity (b\Model,0,EntityYaw#(turret),0,true)

it doesn't really work - if i spin the car, the turret spins, but the bullets don't follow the turret.

i'm on a flat plane, i just need the bullets to just align with the turrets direction on the flat horizontal plane.


big10p(Posted 2004) [#2]
I guess you're not parenting the bulletes to the turret, then?

Try using EntityYaw(turret,1) in the RotateEntity command, instead.


ryan scott(Posted 2004) [#3]
that worked, thanks!

if the bullets are children of the turret, they will move after being shot, when the turret turns.


big10p(Posted 2004) [#4]
Yeah, I was meaning you could un-parent the bullet from the turret once it has been fired.