so here's the thing.. i tried to follow the example from sparky's collision about the raycollision (i use it for making bulletmarks).
I already make a map and an object as enemy. When i applied the raycollision, it only works with the map... but not the enemy... what is wrong with my code?
this is the map and enemy setup
function makeLevel()
make object sphere 10,-40000
load image "cloud.jpg",5
texture object 10,5
load object "mymap.x",1
sc_setupComplexObject 1,1,2
position object 1,0,0,0
position object 10,0,0,0
load image "crosshair.bmp",2
sprite 1,435,283,2
set sprite 1,0,1
endfunction
function makeEnemy()
load object "Ninja.X",3
position object 3,-2064,-45,2563
scale object 3,350,350,350
set object speed 3,40
loop object 3,20,50
SC_setupcomplexObject 3,2,2
endfunction
and this is the ray collision example from sparky's that i use
function gunControl()
if mouseclick()=1
play object 18,67,75
play sound 1
bullet=100
oldx#=camera position x()
oldy#=camera position y()
oldz#=camera position z()
move camera 2000
xcam#=camera position x()
ycam#=camera position y()
zcam#=camera position z()
move camera -2000
collidebul=SC_rayCastGroup(0,oldx#,oldy#,oldz#,xcam#,ycam#,zcam#,0)
if collidebul>0
newx#=SC_getStaticCollisionX()
newy#=SC_getStaticCollisionY()
newz#=SC_getStaticCollisionZ()
normx#=SC_getCollisionNormalX()
normy#=SC_getCollisionNormalY()
normz#=SC_getCollisionNormalZ()
position object bullet,newx#+normx#/10.0,newy#+normy#/10.0,newz#+normz#/10.0
point object bullet,newx#+normx#,newy#+normy#,newz#+normz#
show object bullet
bullet = bullet + 1
if bullet>140 then bullet = 100
endif
endif
endfunction
so, am i doing anything wrong here? Please help me...
I also attached the complete file... however, i'm sorry because the comments and variables are not in English because it's not my primary languange...
i'm a newbie...