Hello first time here. I have recently started making a 3d game but i ran into a problem. Basically i dont know how to make things colide so you cant pass through objects. I have setted up a basic player movement and rotating. I have setted up the world gravity and created the 3d physics world. I dont know how to continue from now on.
player=loadobject("bean.3ds")
barrel=LoadObject("Explosive_barrel.3ds")
barrel_texture=LoadImage("Explosive_barrel_img.png")
SetObjectImage(barrel,barrel_texture,0)
plane=CreateObjectPlane(10,10)
plane_img=LoadImage("grasstexture.jpg")
SetObjectImage(plane,plane_img,0)
SetRawMousePosition(960,540)
SetObjectPosition(player,5,0,0)
SetObjectPosition(plane,0,-1.5,0)
RotateObjectGlobalX(plane,90)
Create3DPhysicsWorld()
Create3DPhysicsStaticBody( plane )
Create3DPhysicsDynamicBody( barrel )
Set3DPhysicsGravity( 0, -3, 0 )
SetObject3DPhysicsRestitution(plane, 0.75 )
SetObject3DPhysicsRestitution(barrel, 0.75 )
do
if getrawkeystate(27)
end
endif
if GetRawKeyState(87)
MoveObjectLocalZ(player,0.2)
endif
if GetRawKeyState(83)
MoveObjectLocalZ(player,-0.2)
endif
if GetRawKeyState(68)
MoveObjectLocalX(player,0.1)
endif
if GetRawKeyState(65)
MoveObjectLocalX(player,-0.1)
endif
yangle as float
xangle as float
yangle=GetPointerX()*720/1920-90
xangle=GetPointerY()*180/1080-90
if yangle=-90 or yangle>629
SetRawMousePosition(960,GetPointerY())
endif
SetObjectRotation(player,0,yangle,0)
SetCameraPosition(1,GetObjectX(player),GetObjectY(player)+2,GetObjectZ(player))
SetCameraRotation(1,xangle, GetObjectAngleY(player), GetObjectAngleZ(player))
Print( yangle )
Sync()
loop
thats all i done it doesnt say anything the screen goes black and the loading cursor appears then it shuts down. Anyone care to help?