A camera represents the view of the player. Check out this page for general information on ludiloom cameras. Here, we will show how to create and configure a first-person camera, a third-person camera and an RTS.
First-person camera
As in most first-person games, the camera will control the direction where the character is looking and where the character is turned to. To create a camera, right-click on the arena object in the tree >> new >> camera. The Camera Editor will appear so you can create the camera and edit its parameters:
You can find out more about this interface here, but for this tutorial you just have to:
- Write cam in the camera name.
- Change Near clip distance to 10.
- Disable Use Smooth Translations, or lower the Smooth Elasticity to 1.
- Disable all the other options, but enable Use Mouse to Control Orientation (like in the image above).
- Save the camera.
Now, attach the camera to the model. Right-click on the model in the tree (or directly on the 3d model in the game environment) and select attach >> camera >> cam, like this:
Now, the camera should be at the player's feet like this:
You have to position it properly:
- Right-click on the camera base (the big white arrow thing) and press move. As an alternative, open the Scene Editor from the menu.
- Move the base of the camera up to the character's face and a little to the front.
- Rotate the base of the camera so the arrow points in same direction where the character is looking.
- Click on the camera (the camera thing that should be above the character) and set it's position to {0,0,0}, or click the reset button on the Scene Editor.
If everything goes as planed, you'll end with something like this:
Probably, the 3d model (or parts of it) will get in the player's field of view. In most first-person shooters, the 3d mesh of the player character doesn't exist. They only put a model or an overlay of the arms and weapon in front of the camera. There are other ways to workaround this problem. In Desert Attack, we made an invisible material to apply to the player's character. Take a look at this tutorial about the game.
Third-person
In a third-person view, the camera will follow the character around. To create a camera, right-click on the arena object in the tree >> new >> camera like this:
In the Camera Editor, write cam in the name field and activate the Use Mouse Wheel to Zoom check-box.
Press new to finish creating the camera. Now that the camera is in the game environment (you should be seeing it in the position (0,0,0), you have to rotate it so that it points to the camera base. Click on the camera, open the Scene Editor and activate the rotation gizmo to rotate the camera. To change the rotation axis, press tab. Rotate the camera until you have something like this:
Then, click on the base of the camera (the arrow thing) and rotate it 180ยบ horizontally:
Finally, we have to attach the base of the camera to the model. Right-click on the model >> attach >> camera >> cam:
Open the console (F11) and write the following code to activate the Camera:
Arena:setActiveCamera("cam");
And that's it! This is how your game should look after switching to play mode (alt+1):
RTS
Most RTS use the bird-eye view, and we will show how to configure one in ludiloom. Right-click on the Arena object in the tree >> new >> camera.
In the Camera Editor make the following changes:
- Set the name to cam.
- Set the Move Speed X to 10.
- Set the Move Speed Z to 10.
- Set the Move Limit X between 300 and 1200.
- Set the Move Limit Z between 500 and 1500.
The terrain is 1500 (by default, you can change this in the Terrain Editor), so we limit the movement of the camera in a way that the player never sees the edges of the terrain.
- Set the Min Zoom Distance to 200.
- Set the Max Zoom Distance to 600.
- Activate Use Screen Edges to Move the Camera.
- Activate Use Mouse Wheel to Zoom.
- Activate Use Terrain Height Instead of a Fixed One.
- Press new.
Then, right-click on the camera and press rotate:
Press tab to change the widget to the correct axis and rotate the camera like this:
To activate this new camera, write in the console (F11):
Arena:setActiveCamera("cam");















