Playmaker Forum

PlayMaker Feedback => Action Requests => Topic started by: Kubold on July 08, 2012, 02:16:14 PM

Title: Translate object to target with choosing axis
Post by: Kubold on July 08, 2012, 02:16:14 PM
I would gladly see something like Move to Target, but you should be able to pick certain axis. Right now you can only turn off vertical i think.
It should work like this script:

transform.position.z = Mathf.Lerp(transform.position.z, target.position.z, 0.5);
transform.position.y = Mathf.Lerp(transform.position.y, target.position.y, 0.5);

Basic use would be doing a camera follow a character in 2D sidescroller for example, but only in certain axis, with slight delay, without rotation.
Title: Re: Translate object to target with choosing axis
Post by: Alex Chouls on July 08, 2012, 03:42:15 PM
Good idea. I'll look into the best way to add more control there...

In the meantime, you could use a Set Position action with Late Update checked to clamp certain axis of motion. Or you could combine lower level actions for more control. See attached screenshots.

It helps to think of actions as modular components that can be combined to get exactly the behavior you want


Title: Re: Translate object to target with choosing axis
Post by: Kubold on July 09, 2012, 05:00:48 AM
Awesome!!! Thanks a lot for fast reply!
Title: Re: Translate object to target with choosing axis
Post by: Kubold on July 09, 2012, 05:10:51 AM
First solution seems better for now, since Set Position gives a glitchy/flickering effect sometimes. It "teleports" the object instead of smoothly translating it (at least it looks that way).