playMaker

Author Topic: Mouse Look: What vector?  (Read 2917 times)

Red

  • Hero Member
  • *****
  • Posts: 563
Mouse Look: What vector?
« on: August 12, 2013, 09:38:11 PM »
I've got a mouse-look system in the works using the "Mouse Look" action and i'm curious about what vector it's using so that I can reset them if needed?

What I'm trying to accomplish is that when the right mouse button is held down, it goes to mouselook mode and when the mouse is released, it moves the X rotation of the camera back to zero... but when i go back into the mouse look action, it's as if the mouse hadn't moved so it's still thinking that (essentially) snaps it back to the vertical angle that it was at when it was in this state last.

Is there a way to get access to the vector that this action is using so as to reset it back to default (so the mouse look won't snap when re-entering?)

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3998
  • Official Playmaker Support
    • LinkedIn
Re: Mouse Look: What vector?
« Reply #1 on: August 13, 2013, 10:29:43 PM »
The MouseLook action should probably get it's initial rotation from the GameObject. Instead it sets it to 0,0,0.

I've attached a modified version of the action. Let me know if this does what you need.

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3998
  • Official Playmaker Support
    • LinkedIn
Re: Mouse Look: What vector?
« Reply #2 on: August 16, 2013, 05:15:03 PM »
Did you have a chance to check out the new version?

I'd like to include it in the next update, but want to make sure it does what you'd expect...

Red

  • Hero Member
  • *****
  • Posts: 563
Re: Mouse Look: What vector?
« Reply #3 on: August 16, 2013, 07:02:34 PM »
Ooh, sorry... I just caught this today.

I'll give it a once-over and see how that works.  (though, will this replace the old one or does it have a slightly different name/classification/slot-in-the-action-browser?)

Red

  • Hero Member
  • *****
  • Posts: 563
Re: Mouse Look: What vector?
« Reply #4 on: August 16, 2013, 07:12:06 PM »
Bingo! Yep, this works without that jumping issue!

Awesome and thank you very, very much!

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3998
  • Official Playmaker Support
    • LinkedIn
Re: Mouse Look: What vector?
« Reply #5 on: August 16, 2013, 07:24:50 PM »
It would replace the old one. But I might add a setting to control the new behavior. But only if it really seems like the old behavior is useful.

Basically the old behavior would do this:

1. Reset the rotation to 0,0,0 the first time the state is entered. (bad)
2. Look around while the state is active. (good)
3. Remember the last rotation when the state is exited. (ok?)
4. Restore the last rotation when the state is re-entered. (bad?)

The new behavior should be this:

1. Get the current rotation when the state is entered. (good)
2. Look around while the state is active. (good)

This really seems like the proper behavior.

Unfortunately some FSMs might now rely on 3 and 4 in the original behavior. But you could reproduce those with Get Rotation and Set Rotation.

I guess the right thing to do is add a setting so it doesn't break any existing uses. Something like "Remember Rotation." But it would have to default to true to preserve the old behavior. Which sucks a little bit, since it's not the default behavior you'd expect...

Or make it a new variant action "Mouse Look 3" There already seems to be a 2!

Hmmm, not really happy with either option...  :P

Maybe just fix it and note the new behavior in Upgrade Notes!

Red

  • Hero Member
  • *****
  • Posts: 563
Re: Mouse Look: What vector?
« Reply #6 on: August 16, 2013, 08:25:29 PM »
hmm, okay! i'll have to keep that in mind.

That said, if this is something to consider with the asset-store roll-out (or whever the next update is put in there) could it be something to have the old system as is but have a little blurb in the help sentence (that part that appears in the preview in the action browser) that says that this action is being updated? that way users that are relying on the old system won't be put out by an update and new users will be able to see the updated version?

Still, many thanks for this! this has helped since i'm trying to work on a tutorial that covers the standard FPS loadout (though that's for when i've finished up the others... I still have some loose ends to tie up on those.)