b3d based game
Blitz3D Forums/Blitz3D Beginners Area/b3d based game
| ||
hi I'm working on a third person beat em up game but am having a little trouble with the main parts i.e collision, camera, and that sort because i'm trying to get it so that the player roates and the camera stays ehind that character but when i got the ninja demo which was good in different ways the camera did not do this so could somebody please ehlp me. |
| ||
Hey, how about you try and make the camera follow the player yourself. Just create some code to move the camera to the players location, then you don't need to parent the camera and have alot more control over him.Positionentity camera,entityx(player,true),entityy(player),entityz(player) Place this after your player has been moved each loop. This is only one way to do it, but i think it is the easiest and givs you control over your camera. Just remember also to use: PointEntity camera,player once each loop to, after your positionentity camera. Just to make sure your camera stays locked on the player. |
| ||
which ninja demo? if the one by jhocking then just aligntovector the camera to the players yaw. |
| ||
i'll try and learn it thanks... |
| ||
or parent the entity to the camera. thus binding the camera to the model, or create a pivot and parent the pivot to the entity. then make teh cam follow.... |
| ||
I think you meant parent the camera to the player. I would recommend something similar to that: create a pivot at the same position as the player. Position the camera behind the player looking at him and parent the camera to the pivot. Now move the pivot to the same position as the player every frame (after UpdateWorld so that it will take into account collisions.) Doing it this way gives you a bit more flexibility in terms of how the camera is positioned relative to the player. By the way, pick a more descriptive title next time. Just saying "b3d based game" doesn't tell people a whole lot about what's in your thread. |
| ||
That's what I've done : parented the camera to the player entity. Whenever it moves, the camera moves. I then align the cameras yaw to the players yaw every frame. Done. I also made the camera collide with the world so it doesn't go through geometry. This works really well 95% of the time ... the other 5% I can live with. Heh. |