playMaker

Author Topic: FPS Controller with mouselook and smooth look at problem  (Read 1558 times)

hoyoyo80

  • Full Member
  • ***
  • Posts: 137
FPS Controller with mouselook and smooth look at problem
« on: August 28, 2023, 11:45:03 PM »
Hi all. im making a simple walking sim using character controller and mouselook function.But at one cut scene, i disable the input for player and use smooth look at for the camera to look at a point. After finishing, i restore the input but now my camera is on wrong orientation...Any body can help here.Thanks

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Re: FPS Controller with mouselook and smooth look at problem
« Reply #1 on: August 29, 2023, 10:13:19 AM »
Hi.
Can you show some images / video on your setup as its hard to say with more info.

hoyoyo80

  • Full Member
  • ***
  • Posts: 137
Re: FPS Controller with mouselook and smooth look at problem
« Reply #2 on: August 29, 2023, 08:01:31 PM »
Hi.This is the setup. Player movement and camera look FSM is on the player's body(no mesh it just a character controller capsule) and Camera is a child of the player and the camera has FSM that interact with enviroment. One part is disable the FSM for player input, and use smooth look at for the camera to look at an object. It work fine but when i restore FSM for the player input,the camera orientation now is messy.
Thanks

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Re: FPS Controller with mouselook and smooth look at problem
« Reply #3 on: August 31, 2023, 05:57:50 AM »
Hi.
Maybe you can Save to rotation when you start the smooth look at and on the end use a Tween vector 3 or tween rotation to rotate back to that rotation?

if you want player to start on that angle maybe do rotation on parent and set restriction for axises that you don't want to be turned