First thing I want to get out there, is that there are no actors. This code would be all references to vector points and a “string” (not actually needed in the code). It’s not a code looking for an object/actor following the player for example
Here’s a breakdown of the goal
There is a Vector point that sits at central point. (A Goal post)
This point is the goal post, it is where the point that will be following it, is trying to reach
Another Vector point follows the Goal Point trying to reach it like it’s on a retractable string
As the owner of said point moves this one is chasing the goal point, almost like it is attached by a string that’s trying to pull itself to that point (like a tape measure). It has the following rules:
It has a maximum tension distance it can “Fall behind” Once reached, it can’t get any further away
It can only be dragged along to the X and Y axis, or in another way always has the Z(Zed) of the central point.
And that’s about it. In terms of code, I have a lot of gibberish or half-baked ideas connected to a Vinterp node. I believe I’m over complicating it. It really feels like it should be quite a small line of nodes.
First, vectors and locations use same type variable.
Second calculate all either in world space or local space, pick your flavor, do not mix both unless you calculate/translate it to correct space.
Get Distance_Vector as Ball_Location - Point_location
Get Direction_Vector as Normalize(Distance_Vector)
Get Distance as Length(Distance_Vector)
Now you have all you need. Move_Vector would be: Direction_Vector*1/10th of circle radius (or less depends on you step for moving)
On event tick just add to Ball_location that move_vector value, and move ball to new location.
Also do not forget to adjust for frames with delta_tick from tick event.
It’s the moving to with a max tolerance that’s throwing me off the most. I genuinely have no idea how to tell the engine to move 2 points closer with a max possible distance smoothly over time.
Yup there’s the consistent problem. Every solution is needed an actor to plug into the node, but I’m trying to not use an Actor to move the point. Both nodes apparently will require it in some way to make it happen. But I still feel like I can pull it off with just vector math and a little grease. I just don’t want to make an actor to do this one thing If I can avoid it.
I have it so they are always on the same Z axis. Meaning the sphere won’t drop below it.
I have the distance to the outside edge from a value from 0-1 or 0% to 100%.
I think it will involve a sneaky way of using “Set variable” combined with % throttling (the normalize) and make it scale with the players movement and a minimum pull value to the goal point, to get closet.
Wow…whoops, I got distracted by solving other things a forgot to update this. I found my ideal solution (kinda), while it isn’t complete or fine-tuned. It works without using actors.
This is the WIP version. It doesn’t have modularity (Like adjusting based on speed) which is the big issue and is technically using the event tick which is also big no.