Hello All,
While using Dark Physics, I have my character run into a model of a street light to knock it over by applying force to the light when a collision is detected between the character and the street lights. I'm using many objects to find out what could cause my problem. The street light falls over then disappears. When you walk away from the light it reappears.
I've tried zooming out (camera -z) and it still does it. So the camera isn't too close.
The street light does fall over. But it disappears during the movement. I've tried this with other objects as well. Such as trash bags, a dumpster and more, All the objects disappear during the movement. I'm using .DBO files exported from Giles Lightmapper but I've also tried .X files without the lightmapper and it still does it. I've moved the camera away from the character along the Z axis and it still disappears. I've tried scaling the objects in the 3D editor to be much bigger, thinking the objects were too small, Still disappears and reappears during movement.
I scaled the objects using code, still does it. It's not the model because all objects that I do this with have this problem. The object disappears but the collision box in the simulation is still there. The character still collides with it and cannot walk forward even though the object is gone. The object will reappear after moving around some.
Here's what I'm doing ...
`SET DISPLAY
sync on
sync rate 60
set display mode 1024,768,32
color backdrop 0
set ambient light 40
set camera range 1,35000 rem Set For Skysphere
autocam off
hide mouse
`LOAD AND ADJUST OBJECTS
character = 1
ground = 2
streetlight1 = 3
load object "H-GI-Idle.x",character
scale object character,500,500,500
rotate object character,0,180,0
fix object pivot character
position object character,-35,-1,20
point object character,0,0,0
load object "ground.dbo",ground
rotate object ground,0,90,0
position object ground,-13,-2,30
load object "streetlight1.dbo",streetlight1
rotate object streetlight1,0,90,0
position object streetlight1,-13,-2,30
phy start
`MAKE A MATERIAL FOR MOVEABLE OBJECTS
phy make material 1, "EASYMOVE"
phy set material static friction 1,0.2
phy set material restitution 1,0
phy set material dynamic friction 1,50
phy build material 1
phy make rigid body static box ground
phy make rigid body dynamic box streetlight1,1
`CREATE THE CHARACTER CONTROLLER
phy make box character controller character,object position x(character),object position y(character)+20,object position z(character),1,1,1,1,5,45
do
`GET THE POSITION OF THE CHARACTER
charx# = object position x(character)
chary# = object position y(character)
charz# = object position z(character)
`GET THE ANGLE OF THE CHARACTER
charangx# = object angle x(character)
charangy# = object angle y(character)
charangz# = object angle z(character)
`---- CHARACTER CONTROL -----------------------
`WHEN THE LEFT ARROW IS PRESSED
if scancode()=203
yrotate object character,wrapvalue(charangy#-3)
phy move character controller character,20
endif
`WHEN THE RIGHT ARROW IS PRESSED
if scancode()=205
yrotate object character,wrapvalue(charangy#+3)
phy move character controller character,20
endif
`WHEN THE UP ARROW IS PRESSED
if scancode()=200
phy move character controller character,20
endif
`IF NO KEY IS PRESSED, PLAY THE "IDLE" ANIMATION
if scancode()=0
phy move character controller character, 0.0
endif
`SET THE CAMERA POSITION TO THE CHARACTER'S AREA
position camera 0,charx#,chary#+15,charz#-60
`DETECT IF CHARACTER CONTROLLER COLLIDES WITH STREETLIGHT AND MOVE STREETLIGHT IF THERE IS A COLLISION.
while phy get collision data() = 1
a = phy get collision object a()
b = phy get collision object b()
if a = streetlight1 and b = character
phy add rigid body force streetlight1,200,10,200,1
endif
Endwhile
phy update
sync
loop
I've been banging my head against the wall for days! I cannot figure out why every object I try disappears while moving in the simulation. I've searched this topic in the forum and one guy had the same problem and solved it. All he said was ""It's all about pivot points"" which doesn't tell me much. I've reset all pivots to center in the 3D editor. But to no abail. Fix Object Pivot doesn't work either. Stumped.
Any help or ideas would really be appreciated!
Thanks
Windows:
At Least The hour Glass Works