So I am generally doing UI work and am fairly competent doing most of the elements of UI design in engine including scripting. Gut I have a complex problem and I have not found the answer searching…in fact, it may be that I don’t know exactly what I am looking for…
I have an actor in world and it is a UI widget. Think of it as a computer screen that floats in the air.
It is at the end of a long table (Just a elongated cube for now). I want this screen to move around the edge of the table, always facing the player near his position.
I assume there may be some spline activity going on here but I have little experience with splines. But this seems like a complex problem and I figured I would see if anyone else has any experience with this.
So this first image is the FollowActor. I’m using the tick even to set his location to the distance closest to the player that is on the spline, and then his rotation to his forward vector looking at the player. The variable “Rail to Follow” is a separate Actor blueprint that I made that simply contains a spline, named “Spline Rail Actor”. I expose this RailTofollow variable to the editor, so you can select which “SplineRailActor” to be following. SplineRailActor is simply an empty actor with a SplineComponent. I made sure to check “Closed Loop” In the details panel, in order to keep it a closed loop.
It works ok, but you’d probably want to do something with smoothing the movement out, like not calling the function every tick, and instead using a timeline or something and only lerping to a new destination after a certain threshold has been reached.
Let me know if anything is unclear, and good luck.