EntityCollide works but then...
Blitz3D Forums/Blitz3D Programming/EntityCollide works but then...
| ||
H! I have a 3d world , and a player is moving there :) Then I placed some walls,objects in that world and the player can't go through that :) but when a player collided with a wall then the camera must stop moving and the code don't work ! the player does stop but the camera is still moving. Why ? If KeyDown(key_arrowpad_up) If Not EntityCollided(Object,scene_type) MoveEntity Object,0,0,0.035 MoveEntity camera,camX%,camY%,camZ%+0.035 End If EndIf |
| ||
why don't you parent the camerayou'll need to post more of your code to see whats wrong i think. butmoveentity camera,camx%,camy%,camz%+0.035 why not use MoveEntity camera,0,0,0.035 might help |
| ||
that's all the code exept global camera global object The first thing I tried was but please more information about that parent thing. I never understand that parent/childeren thing. I want like tomb raider a camera that follows the object. that's all. thanks MoveEntity camera,0,0,0.035 but that wasn't working too. |
| ||
Writing a camera system is harder than it looks, but a very simple parented camera goes something like this:object = CreateCube () cam = CreateCamera (object) ; Make 'object' camera's parent... MoveEntity cam, 0, 1, -10 ; Move camera up and back from cube... Now instead of moving the object *and* the camera, just move the object and the camera will follow, as it's attached to its parent. This isn't a very good camera system, but it should explain what joker means by parenting the camera to the object... |