playMaker

Author Topic: first person - turn on spot  (Read 923 times)

jso1980

  • Playmaker Newbie
  • *
  • Posts: 3
first person - turn on spot
« on: August 02, 2020, 01:48:54 AM »
Hello,
I'm first time poster with a newbie question.

I'm working on a full body first person controller at the moment,
currently the character is able to walk/run forward,back and side using
a few float values being sent from get axis to a couple of blendtrees via mechanim

However, I'm stuck on my next step, I've searched through the forums but can't seem to find an answer,
When the character looks down on the spot and turns the camera, I'd like to have the character shuffle his feet in the direction the camera is turning so he isn't slide turning on ice. Can someone please point me in the right direction for this?

nuFF3

  • Beta Group
  • Junior Playmaker
  • *
  • Posts: 74
  • Are we even real?
    • One Month Studio
Re: first person - turn on spot
« Reply #1 on: August 02, 2020, 03:42:33 PM »
This is not really a playmaker thing, but a character animation and inverse kinematic thing.
Sure, you probably need to solve where the feet go (placement in height) by script, but the actual shuffling of the feet is more of an issue that animations will solve.
I think it's best done by having bespoke animations for turning left and right.

The S.T.A.L.K.E.R. games and pretty much every Source Engine game solved this by just moving the feet IK guides when the character has moved or turned a certain amount or when an amount of time has passed.
Hard to explain, they didn't have animations for turning on the spot but did it through clever scripting.

jso1980

  • Playmaker Newbie
  • *
  • Posts: 3
Re: first person - turn on spot
« Reply #2 on: August 02, 2020, 08:39:19 PM »
sorry I think I did not explain that part,

I already have the animation of the character turning and shuffling their feet both left and right.

The problem is I'm unable to figure out how to get the turning speed values from the camera as it turns left and right and link that to the character to trigger the animations.

I've set it up for the character walking forward and back, but can't figure out for the camera looking around

nuFF3

  • Beta Group
  • Junior Playmaker
  • *
  • Posts: 74
  • Are we even real?
    • One Month Studio
Re: first person - turn on spot
« Reply #3 on: August 03, 2020, 08:45:09 AM »
You could use the X axis of the mouse from input, and control it that way.

jso1980

  • Playmaker Newbie
  • *
  • Posts: 3
Re: first person - turn on spot
« Reply #4 on: August 03, 2020, 08:14:09 PM »
I tried getting the X rotation of the mouse..no luck so far,

does anyone know which action is needed for this, I'm guessing it'll need to be the speed of the mouse (change from previous frame?) on the X rotation, not the actual rotation value

nuFF3

  • Beta Group
  • Junior Playmaker
  • *
  • Posts: 74
  • Are we even real?
    • One Month Studio
Re: first person - turn on spot
« Reply #5 on: August 04, 2020, 04:38:49 AM »
There should already be an axis called "Mouse X" in the input tab. If there isn't, create one.
So you'll only need to use a "Get Axis" action and that will store the "speed" of your mouse in a float, perfect for use in with Unity's Animator.