playMaker

Author Topic: Help! Parented object position nearly sticks to child's position  (Read 3869 times)

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 618
    • View Profile
In the version of unity I use (4.3.4) I've been having this problem with empty objects or regular objects. Problem is when I have a game object parented to a empty object that is part of another, it sets it's position close to the child. Like in the video, it prevents me from have a object rotate or move properly.

Is this a common problem in the version of unity I'm using, or would I not have this from with later versions?

https://db.tt/2DSatBXZ
« Last Edit: March 03, 2015, 03:18:50 PM by coffeeANDsoda »

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 618
    • View Profile
Re: Parented object position nearly sticks to child's position
« Reply #1 on: March 03, 2015, 03:18:31 PM »
One thing I didn't mention, can people easily view this video? Since it is in a m4v, or just want me to post pics? Still having problems with this issue.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14400
  • Official Playmaker Support
    • View Profile
Re: Help! Parented object position nearly sticks to child's position
« Reply #2 on: March 04, 2015, 01:16:59 AM »
Hi,

 Basically you can expect objects marked static to be moving, they should not,but you mark them static because then the lighting system ( and other system) can rely on the fact it's not going to be moved).

now, I would try to not have this static object as a child and simply connect them using playmaker with a get position of the parent and then a setposition of this static, maybe it could work ( same with rotation).

 Have you tried that?

Bye,

 Jean

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 618
    • View Profile
Re: Help! Parented object position nearly sticks to child's position
« Reply #3 on: March 04, 2015, 01:21:29 AM »
Have I tried to set up FSM's to trigger rotation on empty objects, regardless of the axis position issues? 

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14400
  • Official Playmaker Support
    • View Profile
Re: Help! Parented object position nearly sticks to child's position
« Reply #4 on: March 04, 2015, 01:27:04 AM »
Hi,

 no, you simply have an fsm that will manually match the position and rotation of this static object with a parent, so you don't actuall parent it, you just force it to act as if it was by manually synch the position and rotation.

 Bye,

 Jean

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 618
    • View Profile
Re: Help! Parented object position nearly sticks to child's position
« Reply #5 on: March 04, 2015, 08:45:33 PM »
So for the record, I could use a unparented empty object to operate all three mechanical fingers? Plus what can I use to rotate 3 empty objects all at the same time? If I use wait 3 times, it goes into the first one.
« Last Edit: March 04, 2015, 09:42:09 PM by coffeeANDsoda »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14400
  • Official Playmaker Support
    • View Profile
Re: Help! Parented object position nearly sticks to child's position
« Reply #6 on: March 04, 2015, 11:18:50 PM »
Hi,

 Also, maybe this calls for the use of this fantastic asset ( Final IK)

http://u3d.as/content/root-motion/final-ik/6ec

 This will make your rig a joy to work with.

-- unparented Object, yeah you can always manually connect objects together.
-- use a manager hosting the angle and each finger would go get the angle from that manager using "Get Fsm float".
-- I don't get your wait sentence. please reformulate :)

 Bye,

 Jean

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 618
    • View Profile
Re: Help! Parented object position nearly sticks to child's position
« Reply #7 on: March 04, 2015, 11:52:06 PM »

-- unparented Object, yeah you can always manually connect objects together.
-- use a manager hosting the angle and each finger would go get the angle from that manager using "Get Fsm float".
-- I don't get your wait sentence. please reformulate :)

Unparent Object with a detach child action? Using a manager with a Get FSM float action, first of all, is that with local variables or globals? Assuming that you think you want me to set up a state with that action prior to it transitioning into other states that deal with rotation actions?

Before you mentioned the first two, I did previously set up a state with three transition events and three wait actions to see whether or not it would transition into three states at the same time. Not successful though.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14400
  • Official Playmaker Support
    • View Profile
Re: Help! Parented object position nearly sticks to child's position
« Reply #8 on: March 05, 2015, 01:11:44 AM »
Hi,

 no, don't overthink this :)

 you have an fsm at the wrist of your claw, this fsm stores the angle of your fingers, each finger have an fsm using "get fsm float" on that wrist and rotate locally of that angle, that's it!

for the position, each limb should get the transform of its virtual "parent" and set itself to that position plus an offset. Typicall, for this, I always create a limb with a dummy gameobject that is the pivot point of the child, and then the child expects to find a child "Anchor" on its virtual "parent" and then knows exactly the position and rotation to match.

Bye

 Jean

redikann

  • Full Member
  • ***
  • Posts: 174
    • View Profile
Re: Help! Parented object position nearly sticks to child's position
« Reply #9 on: March 05, 2015, 01:15:43 AM »
My biggest suggestion would be to look at your relationship scale and translate (xyz). If you are  parenting a rendered mesh to an empty game object then I would guess you want the empty to be a controller in a sense. Therefore you might get better results if you get your mesh object back to a scale of 1 (xyz) and use your empty game object parent to scale it to size if needed and then rotate it with the empty game object. When your translate component  is wildly different between a Parent /child you can get very unexpected results.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14400
  • Official Playmaker Support
    • View Profile
Re: Help! Parented object position nearly sticks to child's position
« Reply #10 on: March 05, 2015, 01:19:37 AM »
Hi,

 the problem here being that the childs are flag static ( I think), that's the issue first and foremost, but you have a good point, weird scaling can affect rotation down the hierarchy.

 Bye,

 Jea

redikann

  • Full Member
  • ***
  • Posts: 174
    • View Profile
Re: Help! Parented object position nearly sticks to child's position
« Reply #11 on: March 05, 2015, 01:40:44 AM »
I agree with the static flag from the rendering?lightmapping perspective. If you bake and then move your object in real time that bake is worthless. But from a Parent /child perspective if you parent an object and then translate and rotate the child to correctly place it, you are done leave it alone. From here on out you need to rely on the parent for any scaling and rotation. If you start rotating and scaling the parent/child independently it will all be wasted.

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 618
    • View Profile
Re: Help! Parented object position nearly sticks to child's position
« Reply #12 on: March 06, 2015, 08:08:56 PM »
When it comes to scaling doesn't seem to be huge, when I dragged the mesh into the scene it was 1 on each axis I think. I still seem to have the same problem with rotating a object with 1 or 2 children still and I upgrade to 4.6.2.