playMaker

Author Topic: Parent localPosition Transform doesn't exist? [SOLVED]  (Read 1538 times)

SawyerK

  • Junior Playmaker
  • **
  • Posts: 93
Parent localPosition Transform doesn't exist? [SOLVED]
« on: January 06, 2020, 06:50:45 PM »
Hi!
I have this basic pick up and throw FSM, but i can't seem to figure it out how to set the picked up object's rotation to the parent object's localPosition. It only has World and Self. I tried Transform direction and Inverse Transform direction, but the object just starts spinning or does nothing. Is there a way to set the rotation to the parent's localPosition, so i can rotate the object with the mouse wheel?
I stuck on this for three days now, please someone help!
« Last Edit: January 13, 2020, 08:57:27 AM by SawyerK »

daniellogin

  • Full Member
  • ***
  • Posts: 215
Re: Parent localPosition Transform doesn't exist?
« Reply #1 on: January 06, 2020, 09:34:30 PM »
"Self" is local  ;D

daniellogin

  • Full Member
  • ***
  • Posts: 215
Re: Parent localPosition Transform doesn't exist?
« Reply #2 on: January 06, 2020, 09:49:10 PM »
Oh and aside from Self = Local

You can do a Get Rotation action. You area already identifying the parent object some how... because you are setting an object to be it's child. Right? So do a Get Object using that same reference.

OR

If for some reason it's hard to get that reference. Another way to do it (once you have the object already a child) is to do a Get Parent on the throwing object. So yeah, once you identified that parent, do the Get Rotation.

SawyerK

  • Junior Playmaker
  • **
  • Posts: 93
Re: Parent localPosition Transform doesn't exist?
« Reply #3 on: January 07, 2020, 08:32:42 AM »
With GetRotation the picked up object just starts spinning. :D

daniellogin

  • Full Member
  • ***
  • Posts: 215
Re: Parent localPosition Transform doesn't exist?
« Reply #4 on: January 08, 2020, 05:31:53 AM »
With GetRotation the picked up object just starts spinning. :D

You need to provide some more specific information to debug this. Start with how the parent is 'found'. Then how you add an object as it's child. Then how you do the Set Rotation.

SawyerK

  • Junior Playmaker
  • **
  • Posts: 93
Re: Parent localPosition Transform doesn't exist?
« Reply #5 on: January 08, 2020, 08:01:53 AM »
Here's all of it. The FSM is on the PlayerCamera, it's a basic mouse pick event that stores the gameObject as pickedGO. Then i get the playerCamera's child the Guide and i SetParent the picked object to it. :D