playMaker

Author Topic: getting/setting pos & rot of player  (Read 1728 times)

richardh

  • Junior Playmaker
  • **
  • Posts: 97
getting/setting pos & rot of player
« on: October 05, 2015, 01:39:26 PM »
Hi again
In my scene I have the standard FPController (FP Camera view). at runtime I want to store the exact position and rotation so that on pressing the 'P' key I will jump back to that start position from where ever my current position might be in the scene. Basically I want to set and store the start position AND rotation so I can jump back to it at any point upon pressing P. Now I have set up a PM with Get Position and Get Rotation in the first FSM. then on key down (p) PM goes to the next FSM which simply SETS the FPC to the original Positions/Rotations. Except only the position seems to be working. Rotations (although they are certainly stored in a variable, do not work. I have tried a vector3 variable (which works for position) and I've tried quarterion but although the variable does set correctly at runtime it seems to be ignored when i press P and resume start position (which DOES work).

what should I be doing?

thanks

richardh

  • Junior Playmaker
  • **
  • Posts: 97
Re: getting/setting pos & rot of player
« Reply #1 on: October 09, 2015, 04:33:21 AM »
BUMP!
This is the one thing that's stumping me. Any offers on how to 'reset' a GameObject (FPC) to an original ROTATION? I have got the Position sorted but the darn thing won't obey my FSM to rotate to a set rotation.

thanks
R

ManicMinerUK

  • Junior Playmaker
  • **
  • Posts: 51
Re: getting/setting pos & rot of player
« Reply #2 on: October 11, 2015, 08:23:01 AM »
This is a bit of a puzzle because what you are doing should work fine - I would assume it's some kind of interference between the first-person controller component and your scripts... Which seems likely as the FPC will be doing things with your player objects rotation almost constantly.

I would try disabling the FPC component in your script before you reset the rotation and then enabling it afterwards, see if that makes any difference?