PlayMaker Feedback > Action Requests

Translate object to target with choosing axis

(1/1)

Kubold:
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.

Alex Chouls:
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


Kubold:
Awesome!!! Thanks a lot for fast reply!

Kubold:
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).

Navigation

[0] Message Index

Go to full version