My goal is to be able to make two characters move around eachothers axis with a specific radius, as if both of them are holding the same object.
I’ve tried to use GetRightVector from it’s current rotation, but the character slowly moves further and further away, which means i have to make the character move forward when he’s too far away. This causes more trouble and makes it more complicated than it should be.
In Event Step, you can measure the distance between the characters, and if it’s too far away, move slightly closer; if it’s too close, move slightly further away.
This is really simple, actually, assuming you can get Character B from within Character A and vice versa.
Inside B, the vector to char A is simple Apos - Bpos; compare the length of this vector to something desired. If too long, add some small constant times the negative of the vector. If too short, add some small constant times the normalized version of the vector. Purposefully don’t normalize before adding the negative, to make a stronger attactive force the further away they are.
Maybe it will help if you think of it like a clock face, with Character1 at the end of the minute hand and Character2 at the clock’s center.
All we’ve done is rotate the minute hand around Character2 by Character1’s amount (Speed x MoveForward). This gives us a new direction the minute hand is facing.
We can then use the initial distance between the 2 characters (VectorLength) and multiply that with our new DirectionVector, and add that to Character2’s location to give us a point at the end of the minute hand to place Character1.
Hope that makes sense. Probably not. I tried!
Anyway, the variable is just a variable I added in the ThirdPersonCharacter’s Blueprint (Variable Type=Character Reference).
I used the Level Blueprint to set their values when the level starts.
You’re welcome man. It’s definitely worth playing round with that RotateAroundAxis node, it comes in handy a fair bit.
Also; I know exactly how you feel spending time trying to figure things out. That’s how I learned this stuff too.