(I am aware that a lot of stuff can be connected so it looks cleaner, just haven’t done it yet. However if you know a more performance efficient way to do it I should know, that’d be helpful.)
The issue that comes up is weird results coming from actually pressing the input. The timeline goes from 0 to 40 and the start location is at 100.
If I press W 4 times it’ll go
X = 100 (intended: 100)
X = 240 (140)
X = 380 (180)
X = 520 (220)
The other issue that will show up later is the way my blueprint is set up now, if I rotate my camera 180 degrees I will essentially move backwards if I press W. Is there a better solution than making a branch with 4 variables for each rotation (90, 180, 270, 0) and change X/Y depending on which variable is checked?
I think the W going backwards is because you use relative rotation. So in terms of world rotation you haven’t turned, hence pressing forward will go backwards.
Look at using Set World Location, or Add World Offset instead.
I manged to solve my ridiculously increasing speed issue (I replaced get world location with get relative transform, breaking the transform to get location and use that value.
Now I just have the issue with it not moving the direction I want when I press W. I’ve tried world location and world offset which both didn’t work, however I adopted world rotation over relative. Right now my current solution is very silly but works. (I currently have a branch checking which direction I’m facing and I do different operations based on it)
if my worldRotation is -1 to 1 it transforms X positively by 280.
if my worldRotation is 89 to 91 or -269 to -271 it transforms Y positively by 280.
if my worldRotation is 179 to 181 or -179 to -181 it transforms X negatively by 280.
if my worldRotation is -89 to -91 it transforms Y negatively by 280.
Doing something like would, would I expect any performance problems?
E: I see you are moving a FirstPersonCamera around manually. I was doing similar with a 3rd Person Camera and found it awkward. It is much easier to use a Pawn(or Character) class to deal with movement in the world. You can then attach a camera to that class and set the relative location (eye height for example). This is how the editor camera works for example.
Are you using a timeline or matinee for this? The blueprint looks odd to me:
I don’t recommend using “SetRelativeLocation” as this sets a local position I believe. You’ll want to inerpolate between your new location and your old location to get a smooth transition but if you don’t care about that, setting world location is fine. The other issue you’re going to have is setting your location relative to your camera orientation.
Should look more like this i think: (wasn’t able to test this one)