playMaker

Author Topic: [SOLVED] get position space - self  (Read 5155 times)

Sjones

  • Full Member
  • ***
  • Posts: 203
[SOLVED] get position space - self
« on: September 17, 2012, 06:59:26 AM »
the self space doesn't work in get position it still works in world space, could be the same for rotation.

there may be an issue with set position and rotation too.

how to:
fsm with get position.
specify game object
play level
set unity move to local from global
move object in local space
observe get position store vector in world space with space set to either self or world.
« Last Edit: September 24, 2012, 08:16:25 AM by Sjones »

Sjones

  • Full Member
  • ***
  • Posts: 203
Re: get position space - self
« Reply #1 on: September 19, 2012, 04:20:55 AM »
can anyone confirm this? or is it something I am doing wrong, I am using this for a camera control, after rotating the camera and scrolling around it moves in the direction it was before it rotated, thus moving in the world axis and not local.
thanks

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: get position space - self
« Reply #2 on: September 20, 2012, 02:03:47 AM »
Hi,

 Can you provide a sample? I can't really get my head around what you are explaning :)

bye,

 Jean

Sjones

  • Full Member
  • ***
  • Posts: 203
Re: get position space - self
« Reply #3 on: September 20, 2012, 07:18:55 AM »
hi, sorry for any confusion, please find attached a quick level, in it the camera moves on the camera fsm

the position is posted to the screen in its world X,Y,Z position and also its self (I call local) X,Y,Z position

the camera move fsm has a start and stop, just make it go to the next state to activate

the camera move is set to get and set its position in self space

note that the position posted to the screen for the self and world are the same

expected result the camera to move in its self Z and not the world Z axis

also moving it in editor while the scene is running in local mode all co-ordinates update in world position
« Last Edit: September 20, 2012, 07:22:28 AM by Sjones »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: get position space - self
« Reply #4 on: September 21, 2012, 01:35:20 AM »
Hi,

 your file doesn't want to open at all. I double click on it and it doesn't fire anything in Unity...

what Unity version are you using?

bye,

 Jean

Sjones

  • Full Member
  • ***
  • Posts: 203
Re: get position space - self
« Reply #5 on: September 21, 2012, 08:45:38 AM »
I am using 3.5.5f3 I re-opend the file on my computer and was fine, I tested it on my laptop and I had the exact same problem, to fix it I had to put it into the asset folder of a project and then open it in the project tab within untiy,  it then opened up fine, if this fails to work for you I will get some screen shots or video

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: get position space - self
« Reply #6 on: September 24, 2012, 03:16:39 AM »
HI,

ok, the camera is not attached to anything, hence its local position IS world position. but here that would not help anyway:

 Make sure you fully read the unity doc on transform, because it does behave slightly different from what you could be used in 3d soft like mx or maya.

 when you query the position of gameObject, you will always get the world position, not the local position, you need to explicitly query for the local position to get it.

bye,

 Jean

Sjones

  • Full Member
  • ***
  • Posts: 203
Re: get position space - self
« Reply #7 on: September 24, 2012, 08:15:33 AM »
Thank you very much for the info, I understand the difference and think I have found a solution for what I was expecting, putting this as solved