playMaker

Author Topic: How to lock camera rotation  (Read 1228 times)

Ukiyos

  • Playmaker Newbie
  • *
  • Posts: 6
How to lock camera rotation
« on: February 20, 2019, 03:49:01 PM »
Trying to create a inventory screen, where you cant look around, but it unlocks your mouse so you can select different parts, anyone know how? thanks in advance!  :)

Athin

  • Full Member
  • ***
  • Posts: 163
Re: How to lock camera rotation
« Reply #1 on: February 20, 2019, 09:27:49 PM »
Hey there,

It highly depends on what your set up is and without knowing more about how your project works makes it hard to solve.

I'm guessing that your mouse controls your camera and when you open the inventory, you want it to stop controlling it?  If thats the case then a simple bool check can solve that.  When the user goes into the inventory (Or any menu you want this for) Set a Bool on the camera to True. 

Then the camera can have a simple Bool check where as long as that bool is False, the camera is free to move otherwise disable input.

Hopefully that will help or at least point you into the right direction.  If I guess wrong or didn't help try to explain the project a bit more so I can try to help again.

Thanks

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: How to lock camera rotation
« Reply #2 on: February 20, 2019, 09:56:03 PM »
Hi.
You can also use events.

Set a state, Call it "Disabled" for example.
Make an event, Call it "Disable Look" for example and also make a "Enable Look"
place the "Disable Look" as global on the "Disabled" state.
and the other one on the state where you have the mouse rotating.

Then When opening your inventory screen send the "Disable Look" event to the fsm and when closing send the "Enable Look" event.

Here is a video about events :


Ukiyos

  • Playmaker Newbie
  • *
  • Posts: 6
Re: How to lock camera rotation
« Reply #3 on: February 22, 2019, 12:18:46 AM »
Thanks guys!