Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: nFighter on July 29, 2018, 08:51:35 PM

Title: Get Transform - action
Post by: nFighter on July 29, 2018, 08:51:35 PM
Hey, guys! Small question. There is an action Get Transform, but there is nothing like Set Transform... What's is this action about, how should I use it?
Title: Re: Get Transform - action
Post by: jeanfabre on July 30, 2018, 06:02:42 AM
Hi,

 you can't assign a Transform Component, it's alwasy here by default when you create a GameObject.

 Do you actually mean copy the position, rotation and scale from one Transform to the other?

 Bye,

 Jean
Title: Re: Get Transform - action
Post by: nFighter on July 30, 2018, 01:12:36 PM
Yes, I thought it's an action for copying the transforms all together...
(for now i'm using separated get&set position, rotation, scale)
Title: Re: Get Transform - action
Post by: jeanfabre on July 31, 2018, 03:46:18 AM
Hi,

 nop, and you are right, the best way is to use the get&set position, rotation, scale actions.

 getting and setting a component is usually not recommanded because it's very bad for perfs, and here on top of that, you bumped into the one exception in Unity where a Transform is a special Component of a GameObject, it's unfortunate, because it would be great to have a gameobject without transform when they deal only with logic and not actual render or taking part of the physics.

 Bye,

 Jean