I cant get my code to work. Here's the sample where I move the monster towards the person, then update it, then check for shooting and intersecting the monster with the gun's ray
note that object 12 is the gun and object 31 is my monster
` ai
point object 31,camera position x(),0,camera position z()
move object 31, 3
rotate object 31,object angle x(31), wrapvalue(object angle y(31) + 180),0
updateObjectDBC(31)
updateObjectDBC(31)
if mouseclick() = 1
play sound gunshot
shells#(0) = shells#(0) - 1
`next variable is for kick
kick# = 5
sx#=object position x(12)
sy#=object position y(12)
sz#=object position z(12)
move object 12,1000
ex#=object position x(12)
ey#=object position y(12)
ez#=object position z(12)
move object 12,-1000
hit = intersectObjectDBC(31,0,sx#,sy#,sz#,ex#,ey#,ez#,1)
if hit = 1
sleep 1900
endif
if i set up the object w/ setupObjectDBC(31,0,1), it works fine, but with terrible frame rates. i only have the sleep in there to tell when it's working, and it doesn't work at all when I'm using updateObjectDBC(31)
what am I doing wrong? thanks in advance
verydevastating.com