Can someone give me some advice. im trying to move my character only 100untis on each movement in either direction.
But the timeline don’t seem to be giving me the same numbers each time, and i need to keep my character on a grid.
What i missing when using timeline or delta ticks
Thanks in advanced for any help.
I think you can do this without time lines in this particular case. Please take a look at the following thread. The topic is somewhat different because it deals with stepped rotation instead of movement, but you can easily port it.
I’m not having any problems with rotating the character.
I want to move him 100 units forwards backwards… left … right
“Vinterp” dont seem to slide the character it teleports him into location…
And i want a nice motion tween.
Adding a Linear interpolate (Lerp) node after the timeline should give you the smooth transition between the start and end points you’re looking for. Use the current position as the A and an add node (your starting position + how much you want to move) as the B. Then you just need to set your timeline from 0-1 in the y-axis and the amount of time you want the Lerp to take in the x-axis and plug that into the Alpha of the Lerp.
Been looking for similar myself, I seen you post on my link too in the forums, but no one has a solution. I think it a limitation in the engine. It’s pretty easy to move to 100 units, but essentially it teleports so looks stupid and no way can you put an animation in.
I’ll keep trying and post you any results I get; as no one else seem to understand the issue.
hi. thank you for helping, any chance you can do a quick screenshot, because not matter what i try. it does not give me the correct 100units only movement.
Actually that was only for a reference. You can use that blueprint with small modifications. First you will want to use VInterp instead of RInterp. Also instead of adding 90 degrees, you will add 100 units to the Target vector.
The idea here is to defer the actual work of moving the character into the Tick() event. So when you press the Keys to move the charcter, you dont actually move. Instead you update a Vector variable by adding/subsctracting 100 units. This Vector reprecents where you intend to move. When the Tick function is fired, it will check if you are at the intended location. If not, it will try to move your character to the intended location step-by-step (accomplished by VInterp).
As you might have noticed, the link I posted before shows exactly this. However it shows how to rotate instead of moving. But the logic is exactly the same.
This is because each time you are adding 100 units to the ‘present’ relative location which is getting updated after each timeline iteration.
So instead of adding 100 units to the current relative location, store the relative location into a local variable at the beginning (the key press), Then add 100 units to this local variable. This result should be fed into the Interp node.
Otherwise you will end up moving a lot more distance than you’d want to.
From the object you get the mesh and link it to the function. For the desired amount of units first get actor location and to this make a vector+vector. Inside the coordinates of the vector you set the ammount of units. Attach that vector to Target relative location, and set Over Time to ‘0’. In my case i’m using the left arrow to move it -400 in ‘Y’ direction. This also moves other components of the actor in a grid.
If the landscape were an actual grid with invisible point mesh objects, aligned in 3D software. Then imported to unreal, using this “move component to” you probably get the accuracy you need.