playMaker

Author Topic: Reset position help.[SOLVED]  (Read 2754 times)

nabilfx

  • Full Member
  • ***
  • Posts: 186
Reset position help.[SOLVED]
« on: February 28, 2017, 06:07:06 PM »
I need to reset the object position relative to the camera. How can i do that?
« Last Edit: April 10, 2017, 06:35:25 AM by jeanfabre »

tcmeric

  • Beta Group
  • Hero Member
  • *
  • Posts: 768
Re: Reset position help.
« Reply #1 on: February 28, 2017, 11:53:35 PM »
Maybe make an empty game object (so it is invisible). Make it a  child of the camera, so it always stays relative. Position it to where you want to object to reset to. When the camera moves, it should move too.

Make a FSM on the empty game object. Add the action "get position". Store it in a variable. Check every frame, so it keeps updating.

When you want to the object to reset, use the action "set position" on the object. Use the variable.


nabilfx

  • Full Member
  • ***
  • Posts: 186
Re: Reset position help.
« Reply #2 on: March 01, 2017, 06:24:11 AM »
The camera has a VR script, I need the object to go back to where it started, relative to the VR camera, in position X and Z, not Y. Is it possible?

Because when i rotate up de VR camera, the object goes up too. I need it to stay in the same Y position while rotate the VR camera
« Last Edit: March 01, 2017, 06:26:38 AM by nabilfx »

tcmeric

  • Beta Group
  • Hero Member
  • *
  • Posts: 768
Re: Reset position help.
« Reply #3 on: March 01, 2017, 07:49:59 AM »
Yes, get position of empty game object. Just get variable for x and z.

Set position for the object. Just use x or z from the variable. Set the Y to be 0 or whatever you want.

The action "get position" or "set position" can set just one or all xyz.

tcmeric

  • Beta Group
  • Hero Member
  • *
  • Posts: 768
Re: Reset position help.
« Reply #4 on: March 01, 2017, 07:50:57 AM »
If this doesnt answer your question, then I dont understand.

Maybe post some screen shots and more explanation.

nabilfx

  • Full Member
  • ***
  • Posts: 186
Re: Reset position help.
« Reply #5 on: March 07, 2017, 09:19:30 AM »
now i get it, works great, thank you!