ambiera logo

Ambiera Forum

Discussions, Help and Support.

folder icon Ambiera Forum > CopperCube > Programming and Scripting
forum topic indicator how to make a fp camera
person icon
cheese
Registered User
Quote
2026-08-22 21:59:02

would do i make my own first person camera controler? i know that theres already a premade one in the engine but i wanted to program my own bcs there some especifect movement mecanics i want to add, so i was wondering if i could somehow make a first person camera with movement in js

person icon
cheese
Registered User
Quote
2026-08-22 22:01:33

and also how do i add a colider to that, like not with the premade one inside the engine but add one with js

person icon
redberylftw
Registered User
Quote
2026-08-28 19:49:03

Both really complicated ideas.

Collision means getting the distance between two objects and if they overlap, prevent the player from moving past it. The way I do it is just set the position to the position just before the overlap when it happens. If you try to manually do x,y,z you'll find out quick that the reposition doesn't do what it's supposed to.

A player controller is a lot more complicated. Here's a little mind map;

Get the player position and rotation
[V]
radius = rot.y * Math.PI / 180
|V|
add-assign values for sine/cosine for rotation
|V|
Get sine and cosine to determine current player rotation
|V|
Determine yaw, pitch and roll for camera
|V|
Position target always forward of current camera rotation
|V|
Get mouse position x and y. If changes + or - to X and Y change camera yaw, pitch and roll
|V|
Lock cursor to screen center with some offset
|V|
Center target = mouse pos offset - offset


Create reply:










 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


icon_holyicon_cryicon_devilicon_lookicon_grinicon_kissicon_monkeyicon_hmpf
icon_sadicon_happyicon_smileicon_uhicon_blink   






Copyright© Ambiera e.U. all rights reserved.
Contact | Imprint | Products | Privacy Policy | Terms and Conditions |