Hi all
I found and edit this code to fit my program. The problem I'm having is the zombies rotates all the time. They look like walking spinning tops. Its very funny to watch but not what I'm aimming for. I want the zombie to point at the player.
if zmobf =0
POINT OBJECT x,X#, Y#,Z# `point zombie at player
`Turn OBJECT left
yang#=wrapvalue(object angle y(x))
dx#=object position z(x)-object position x(12)
dz#=object position z(x)-object position z(12)
angle#=atanfull(dx#,dz#)
if wrapvalue(yang#)> wrapvalue(angle#-15)
if wrapvalue(yang#)< wrapvalue(angle#-1)
right=1
endif
endif
if wrapvalue(yang#)< wrapvalue(angle#+15)
if wrapvalue(yang#)> wrapvalue(angle#+1)
left=1
endif
endif
if right=1 then yrotate object x, wrapvalue(yang#+1)
if left=1 then yrotate object x, wrapvalue(yang#-1)
endif
Thanks for your time.
I'll add something later on.