Say I have a blueprint Character, and I want it to move around an Actor. Like, the Actor stays in place, and the Character only have one movement that goes round and round the Actor like a carousel, and you can control it’s movement speed.
I’ve looked into using a spline based movement but it seems there’s no way to make the spline circular except eyeballing it, and I’m not sure how I can detach and reattach the character to the start of the blueprint once it reached the end of the spline.
You can easily make a circular spine, I have the code laying somewhere. Would have to dig it out, I also posted it in the UE4 forums a couple of years ago.
Another very easy way to make a circular movement is to attach your actor to a springarm component. You rotate the springarm in place while its length serves as radius.
If you do not need the show the trajectory, you can skip the spline mesh part. The support for tilt and ellipsoids is also there. You can remove it, of course.
But again, if you want something straightforward, go for the springarm method.
You do not actually need to attach or detach anything. The whole idea revolves (ehm) around the spline’s length. Use this node GetLocationAtDistanceAlongSpline to output a world location and place your object there.
Feed that node with another spline and your object will follow it. Do in Tick, gradually increasing the GetLocationAtDistanceAlongSpline value and you will end up moving along the spline’s path.
In addition, if you combine it with GetTangentAtDistanceAlongSpline node and you’ll get the forward vector.
Essentially, you’d need to write a function that takes a spline, and ask the mesh/actor to follow the spline you’ve supplied. Attachments will unnecessarily complicate the whole thing.
The end result:
I realise this a crude example! But if you provide a bit more detail regarding what you’re tying to achieve, how you expect the objects to interact with the spline, I might be able to advise with something more tangible.