playMaker

Author Topic: GetPosition Y Value Drift  (Read 3121 times)

SD47

  • Playmaker Newbie
  • *
  • Posts: 2
GetPosition Y Value Drift
« on: October 19, 2011, 11:18:08 PM »
I couldn't find any references to this issue, or one like it so here goes...

I am trying to force the camera to follow the player in two dimensions using the get position action on the player capsule. However I keep having an issue with the Y value, seems to have some sort of semi-random drift downwards despite the inspector showing that the capsule has a static Y value. Unless I am missing something, all it takes to reproduce this issue in 1.2 is a GetPosition action with the Y value being saved to a new variable, I went so far as to create a whole new FSM to prove that it was not because the variable was being used in two states.

Anyone seen this before or know of a work around?

Andrew.Lukasik

  • Full Member
  • ***
  • Posts: 134
    • my twitter @andrewlukasik
Re: GetPosition Y Value Drift
« Reply #1 on: October 20, 2011, 04:57:25 AM »
You're missing something in the process IMO.
What actions do you use to do that whole thing?


BTW: I made that with just 2 actions lately - <Find Game Object> and <Move Towards>. And works like a charm.

SD47

  • Playmaker Newbie
  • *
  • Posts: 2
Re: GetPosition Y Value Drift
« Reply #2 on: October 20, 2011, 07:20:03 PM »
That is what I was thinking, but here are some screen shots of my test code. If you can find anything wrong with what I am doing please let me know.



jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: GetPosition Y Value Drift
« Reply #3 on: November 10, 2011, 12:11:14 AM »
Hi,

 Why do you actually store the position? the example from Andrew is sufficient to do what you want to achieve. Have you tried this move towards action and the constraint se tup of the gameObject? ALso note that the move towards action as a "ignore vertical" which is just what you need as well.

 Bye,

 Jean