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.
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âŚ
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
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