[SOLVED] Assign camera to script

Hello, I made my first project, its a interior room. For the first Person view I used the script from the tutorial. It works fine. The only thing is, that the camera, that is in the editor and a child of the player entity is not used by the script. I changed the properties of field of view and it shows correctly in the editor preview, but as I press play, there must be a new camera created by the script.

the script says

FirstPersonMovement.attributes.add('camera', {
    type: 'entity',
    description: 'Optional, assign a camera entity, otherwise one is created'

what does it mean by assign? how do I do that?

If you parse the FirstPersonMovement script in the Editor

It should give you the attributes so you can select an Entity with. You can either click on field to select an Entity or drag an Entity to it.

IIRC, the FirstPersonMovement script creates a new camera entity if you don’t reference an entity in the Editor

1 Like

so simple, thank you very much for your reply! that helped me!