Hi
In a game im making i have a level and a player object.
The player object is under the level. Now the problem is when i say that the player object is going to position over the level the collision start before the player object have made it over the level so the level is blocking for the player object:-(
How can i fix that?
Here is the code i use:
` A cat`s adventure
`Normal settings
sync on
sync rate 0
hide mouse
`Start the collision system
startcollisionPRO(000000000,000000000,000000000)
`Start the collision debugger
startcollisiondebugPRO()
`Set the exclusive to 0
setcollisionexclusive( 0 )
`Constants
#Constant NCULL_COUNTER_CLOCK 1
#Constant NCULL_CLOCK 2
#Constant NCULL_NONE 3
#Constant TYPE_NGC_ELLIP=1
#Constant TYPE_NGC_MESH=2
#Constant ELLIP_2_ELLIP=1
#Constant ELLIP_2_POLY=2
#Constant RESP_STICK=1
#Constant RESP_SLIDE=2
#Constant RESP_SLIDE_NO_SLOPES=3
#Constant RESP_SLIDE_NO_GRAV=4
#Constant RESP_SLIDE_NO_ACCEL=5
#Constant RESP_NONE=6
#Constant DYN_NO_RESP=1
#Constant DYN_RESP=2
#Constant DYN_RESP_NOTURN=3
`My own constants
`Constant for the first level
#constant type_level=1
`Constant for the player object(the cat)
#constant type_player=2
`The collision types
SetCollisionsPRO(Type_Player, Type_level, ELLIP_2_POLY, RESP_SLIDE, DYN_NO_RESP,Auto_Priority )
`Load level(s)
load object "media/playground/map.x",1
collisiontypePRO( 1,type_level )
`load model(s)
load object "media/models/cat/cat.x",2
collisiontypePRO( 2,type_player )
`position the playground map
position object 1,0,-40,0
`position the player(The cat)
position object 2,0,100,0
rotate object 2,0,180,0
`The radius for player collision
SetObjRadiusPRO(1,object size x(2)/2,object size y(2)/2,object size z(2)/2)
`The player object gravity
SetObjGravityPRO( 2, 2 )
`**The main loop**
do
`Print the frames per second
set cursor 0,0
print "FRAMES PER SECOND : "; screen fps()
`Player control input
if upkey() = 1
move object 2,-3
endif
if downkey() = 1
move object 2,3
endif
if leftkey() = 1
turn object left 2,2
endif
if rightkey() = 1
turn object right 2,2
endif
`Start run the collision system
runcollisionPRO()
`follow cam code
set camera to follow object position x(2),object position y(2),object position z(2),0,10,10,10,0
point camera object position x(2),object position y(2),object position z(2)
sync
loop
Thanks