Stop camera rotation (up and down)

I need help coding the camera to follow something but not be able to look around except in the direction of the item. Can someone please help.
Thanks

Hi @SaltedKetchup,

you can achieve that effect by using the turn item to look at Position - block. You can place it in a forever - block to restrict free camera rotation. Please note that this could lead to an uncomfortable VR experience (because even when you would move your head, the camera looks at only one direction).

Below you can find a demo.

Click the remix button to save it to your own spaces so you can see how it was made :slight_smile:.

1 Like

To achieve a ‘HUD’ effect, you could also parent your text item to the camera. In this thread it’s explained how it’s done, including example:

Thanks,
What i was trying to do was get the camera to go to an object (cinematic effect) and return to the character, but the hud was acting weird.
Thank you for replying

Thanks for replying @Stefan,
But the glitch happens when you have a HUD but add in co-blocks a transition block:


(top half of run parallel block)

Turn (camera) clockwise 90 degrees in 1 seconds.

(Bottom half of run parallel)

Move (camera) to x:0 y: 6 z: 2

End of run parallel

Seems weird, especially since you can’t add physics to then use restriction rotation for physics item.

Hi again,

here is the behaviour I see with the code example you wrote. In the scene is one text item that is a child of the camera, and a boy-item that we’re turning to.

Here some things to consider:

  • Physics items can not be the child of another item unless they are static.I don’t recommend adding physics to HUD elements like texts.
  • However, you could parent items like swords or hands to your camera and then turn them to physics with static enabled to give your camera a physical presence in the world.