playMaker

Author Topic: Smooth Look At --> Locking camera to its final position.  (Read 1110 times)

capodoglio

  • Playmaker Newbie
  • *
  • Posts: 3
Smooth Look At --> Locking camera to its final position.
« on: July 03, 2018, 10:15:08 PM »
Hi there!

3d modeler here, slowly trying to learn Playmaker during the last 3 weeks :)

As long it is being an awesome learing adventure, it now seems like I'm stucked into an issue with the Smooth Look At action.

Setup:
- New Empty scene,
- 1 cube animated to move from the left -> to the right of the screen,
- Default Unity 1st person controller: wasd + mouse

Everything is pretty simple.

In my FSM I've a Smooth Look At action that makes the camera follow the animated cube going from the left to the right of the screen.
All works smoothly, so the player (camera) rotate in order to look at the moving cube.

Once the animation is finished (and also is the FSM) suddenly the camera "jump" in order to look at the mouse cursor, as soon as I exit the smooth look at action.

This makes 100% sense to me, since it's the behavior of the controller telling the camera to look at the cursor.
After being "forced" lo look at the cube, it will now jump back to the mouse coordinates (which can be anywhere, as long as you move the mouse during the cube animation, even if "keep vertical" is checked, it seems like Unity keeps getting mouse input).

At this point, I'm just wishing to achieve something like:
Cube moves to the right --> player look at the cube --> PLAYER (camera) REMAINS IN THAT EXACT POS/ROT where the smooth look at action ended.

Since I've literally 0 coding knowledge, I'd like to achieve this just via Playmaker, hoping that this is just a tricky question for a newbie like me, but that it can be solved with some little support :)

Peace


djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Smooth Look At --> Locking camera to its final position.
« Reply #1 on: July 04, 2018, 04:15:38 AM »
Hi.
The issue is in the "Default Unity 1st person controller" indeed so its best to make your own controller.

As i understand you want the cube to be moved by wasd without mouse look?

For movement you can use 'Get Axis Vector' then if you use the character controller Component then use 'Controller Simple Move' else you can use 'Set Velocity' (every Frame) or 'Add Force' in a single state

verybinary

  • Junior Playmaker
  • **
  • Posts: 81
    • The Museum of Digital
Re: Smooth Look At --> Locking camera to its final position.
« Reply #2 on: July 04, 2018, 10:42:40 AM »
there is an action for the mouse cursor, cant remember the name, it lets you hide the cursor, and/or lock it to the center of the screen. (in my head, its 0,0 but im not sure where the origin point is)
you could try locking the cursor to the middle, doing your animation, then unlocking the cursor? that should ignore mouse movement while the cube is moving.