I’m attempting to launch my currently controlled character to a location the player has clicked on. I’d like the character to launch in an arc from their position and then land on the target location. (Think Thor leaping with his hammer and doing an AOE at the end of the leap)
I’ve tried a number of methods from adding impulse to predicting projectile paths. The closest I got to was using the array of vectors from PredictProjectilePath and then using SetActorLocation from those - this seems to work ok if you turn off Gravity. Unfortunately this leads to a very stuttery experience - as the actor is doing micro jumps from one location to the next - was hoping for something smoother.
I was hoping there was someone out there that has solved this, or something like it?
TIA
I’ve added a couple of bells & whistles, some much needed control, limiters to keep things in check and variables to parametrise it:
The general idea:
we generate a spline between us and the click location with the mid point elevated
we use a timeline to project a point along the spline over the timeline duration
we adjust player velocity so it chases that point closely
In short, it’s a glorified rubberband that works surprisingly well.
LMB: set landing location
Mouse Scroll: adjust the apex of the set jump
1: Execute jump
I’ve added comments where I believe it made sense. Do tell if anything else makes little sense. Not attaching screenshots due to time constraints. Here’s a project link, though:
All script is in the character blueprint, the yellow bit:
So I am trying to reverse engineer this system for a project, because I have something similar in mind but I’m stuck. My actor is not moving on the spline, and I’m almost certain the problem is that the spline is attached to the character (when I spawn another actor on the coordinates and tell him to move along my original actor spline it works perfectly. The problem is probably quite trivial but I don’t know how to solve it.