playMaker

Author Topic: (SOLVED) Scaling Gameobject, scales its Children as well :(  (Read 2769 times)

SawyerK

  • Junior Playmaker
  • **
  • Posts: 92
(SOLVED) Scaling Gameobject, scales its Children as well :(
« on: March 22, 2020, 11:43:33 AM »
I use iTween Scale to, to scale down my Player when crouching, when i grab an item i parent it to the playerCamera which is parented to the Player. The problem is the grabbed object scales down as well with the player and i dont want it to happen. Is there a way so the scaling is only applied to the Player and not the children?




« Last Edit: March 28, 2020, 12:01:34 PM by SawyerK »

Broken Stylus

  • Beta Group
  • Hero Member
  • *
  • Posts: 772
Re: Scaling Gameobject, scales its Children as well :(
« Reply #1 on: March 23, 2020, 08:08:09 AM »
Perhaps this could help you.

SawyerK

  • Junior Playmaker
  • **
  • Posts: 92
Re: Scaling Gameobject, scales its Children as well :(
« Reply #2 on: March 23, 2020, 10:26:59 AM »
Thank you! :D It still scales it down when i crouch but when i release the item it bounces back to its real size, its not that good but i'm one step closer now :/

Thore

  • Sr. Member
  • ****
  • Posts: 480
Re: Scaling Gameobject, scales its Children as well :(
« Reply #3 on: March 23, 2020, 02:28:15 PM »
As the transform is by design inherited from the parent, you can either (1) upscale the grabbed objects, or you can keep them out of the hierarchy that scales down, by (2) linking to a bone/bind/mount/placeholder object.

(1) dynamic: right before the scaling happens, unparent the grabbed object briefly, and after scaling parent again. Or static: find out what the scale factor is in runtime, then just set that value to the grabbed object.

(2) you likely have a bone/bind/mount/placeholder object that is used to move a grabbed object to the desired place in the hierarchy. Instead of parenting, move it as child to separate game object, which is linked to the bone/placeholder with location and rotation constraints (it follows the bone/placeholder without being a child).

Broken Stylus

  • Beta Group
  • Hero Member
  • *
  • Posts: 772
Re: Scaling Gameobject, scales its Children as well :(
« Reply #4 on: March 24, 2020, 11:52:56 AM »
Perhaps don't link the picked item to the player and simply apply the player's hand position to the item in a late update?

SawyerK

  • Junior Playmaker
  • **
  • Posts: 92
Re: Scaling Gameobject, scales its Children as well :(
« Reply #5 on: March 28, 2020, 12:00:56 PM »
Thank you for the help! I solved the problem in an other way. I changed the Height in the controller settings with Float Interpolate, its not as nice as iTween Scale To but it works. :D

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: (SOLVED) Scaling Gameobject, scales its Children as well :(
« Reply #6 on: March 29, 2020, 04:49:40 AM »
Hi.

you can try Playmaker tweens :

https://hutonggames.com/playmakerforum/index.php?topic=20432.0

and use a tween float

Broken Stylus

  • Beta Group
  • Hero Member
  • *
  • Posts: 772
Re: (SOLVED) Scaling Gameobject, scales its Children as well :(
« Reply #7 on: March 29, 2020, 02:09:19 PM »
Try HoTween Free, it might be worthwhile too.