I’m trying to left click drag/move an actor around on just the XY plane. Kind of like the move axis mode in editor, but for runtime instead?
Well that definitely worked as advertised. It did the moving part for sure, but caused some other unwanted buggy effects in my system (understandably). The item I’m moving around is a waypoint cylinder blueprint, part of an array in a RTS style waypoint system made with a spline. With the spline points being the waypoint actor and the connection lines in between them being splinemeshs. Your approach definitely moves waypoint actor around, but erases any other waypoints on the map thus breaking the waypoint system. Also, the splinemesh making up the connection line doesn’t update with the waypoint actor movement.
thats my original
Many ways, depending on what it’s supposed to be used for (as in the end goal since there’s probably more to it than just shifting boxes about); here’s yet another one:
With your approach…
would greatly appreciate solving both problems if possible: (1) the multiple waypoints moving around (2) splinemesh updating dynamically
How do you update it at the moment? It be the matter of connecting it to the Tick update in my example.
erases any other waypoints on the map
thus breaking the waypoint system.
You’d need to show your implementation of this. My example does not have splines. But it should work fine. I have a similar system in place actually:
Also, the splinemesh making up the
connection line doesn’t update with
the waypoint actor movement.
This is normal and does not happen automatically. You’d need to udpdate the Spline Mesh Components as you move the spline points. The SMCs need to be deformed as the spline point movement affects position and tangents. You probably have logic for that already, it just needs to be re-run when a point shifts around; or after you’ve moved that point - if you want it to be more performant.
There’s also the middle ground here. You could recalculate the position and tangents of the affected points only - as in the animation above.
If you’re adding the 10th waypoint, there’s no need to fiddle with waypoints 1-7, but the last 3 may be affected as the spline path changes. If your lines are straight, this may not be necessary, of course.
But you still need to tell the SMCs that their spline points have shifted.
This is my full implementation of adding waypoint to world and creating a spline point, and then adding a splinemesh
Oh that is super cool, yeah thats almost exactly what what I’m trying to implement. Yeah I would like my splinemesh connection lines to shift like yours.
thats how I am currently implementing your approach inside the waypoint blueprint
Don’t want to keep you hanging so I’m just going to say that’s simply not feasible, I’m afraid.
Dozens of screenshots that would probably still make little sense as it’s a small part of a much larger system. That would take hours (a day, even) to clean up, comment and present in a somewhat meaningful way.
But I can see you’re connecting the spline points already with SMCs - why not just insert that update code where the you Set Actor Location above.
Here’s a super rough version:
- the above is separate actor that serves as a manager for spline point manipulation
- each waypoint is an actor (for simplicity’s sake since I’m basing it on the original example - use your own method for adding and keeping track of points)
- we gather all waypoints, clear the spline and create as many SMCs as there are waypoints
- each waypoint actor has a dispatcher that informs the spline manager that a spline is moving:
- we get all waypoint locations into an array and feed the spline with those points
- the spline then iterates through its points and deforms each SMCs according the spline’s current shapes set by the points mentioned above
- the dispatcher that informs the spline that things are moving is called then here:
ok lemme look through this and try to implement it