Parabolic path when using Add Local Transform

Hey everyone,

I am trying to move an object that is connected to the player to the result of the LinecastHit.

In short: everything is working fine, except for when my player turns before releasing the item.

When the player equips the item, the item will be attached to the player and they can walk around with it. As long as the player does not turn, the item will always go in a straight line to the LinecastHit location. But when the player rotates, it always takes a parabolic path towards the LinecastHit location and I am unable to figure out why this is happening and how to solve it. Except for it not looking as I intended, it also prevents the item to reach its destination sometimes, making it stuck in a infinite parabolic movement.

The item release code:

The item equip code:

1 Like

It’s because you’re sampling the object location while the timeline is running.

With timelines, you have to put the start and end values ( here, transforms ) into fixed variables, and run the timeline on those variables, with a lerp.

Also ( yes, a double whammy ), you really need to use ‘set actor transform’ ( or some sort of ‘set…’ node ). You’re currently using 'add… ’ which will end in weirdness with a timelime. As you are experiencing…

Thanks for your responce

I experience no weird behavior because of the timeline. It essentially acts at Event Tick, but because I need multiple events being pulsed on different moments, I use the timeline to prevent a crazy amount of lines going everywhere. The timeline is set on loop and reducing its length does not influence the behavior. Replacing it with Event Tick gives the same results.

So you suggest replacing the ‘Add Actor Local Transform’ with a lerp going into ‘Set Actor Transform’? How does that vary from what I currently have? It feels that ‘Add Actor Local Transform’ is doing the lerp automatically for me without me having to do the final calculation: adding the direction to the current transform location (as the calculation for the direction will stay the same)

I tested it out, and it works, but the item does not keep the rotation it has gotten from the player. If the player turns 90 degrees with the item, the object turns 90 degrees back (to its original rotation). This is fine for now, but I would like to be able to do that

My personal guess is that the issue lies within one of 2 aspects:

  • The rotation influences the way the direction vectors are calculated (or something like that)
  • the ‘attach […]’ and ‘detach from component’ are set up wrong, and I can’t seem to figure out what the “correct” way of doing it is.

For a frame of reference of what the end result needs to be: I want the player to pick up and place certain objects in a Jedi-style way.

Ok, I see, you’re using the TL as tick. So you might as well use tick :slight_smile:

If you do use tick, and you want something to travel evenly from A to B, then ‘interp to const’ is the way. With that setup, you can sample during the process, in fact, it’s required :slight_smile:

But it still would be ‘set …’