Circular movement around location

G’day everyone, I have another question that needs answering.

After some time messing around with different values and just giving anything a go. I’ve come along a method that almost gets perfect circular movement… Almost… All I need now is someone who can take a look at the Blueprint I’ve posted below and tell me why the character moves further away from the center rather than staying the same distance.

This is the only issue I’m currently having with the blueprint but I’m always ready to take some creative feedback on how I could improve in blueprints so even if you don’t see the direct problem but see something else that might cause issues later please feel free to point it out.

Cheers.

BLUEPRINT:

GAME START:

A FEW MOMENTS LATER:

I’d blame the imperfections in float precision here, they would add up over time. Could you confirm this is getting worse and worse as your micro machine spirals out of control.

Here’s a couple of alternatives:

A: Stick & string - attach the static mesh to the business end of a springarm.

Rotating the Springarm in place moves the car forward/backwards. Changing Springarm length serves as “steering”. Not a very flexible approach but it’s robust and simple to implement and control.

B: For that semi-realistic feel, I’d create a circular spline and add a dummy target.

Accelerating would push the dummy along the spline and the car would interp it’s location and rotation towards the dummy with a fairly high InterpSpeed. Steering is realised by resizing of the spline.

A bit more complicated to implement but quite flexible. If you are after a simplified driving model, you could probably skip the dummy altogether and just move the car’s mesh along the spline.

Thank you for your reply, I did some testing and I can confirm it is the imperfections of float values.
As for the answers you’ve provided…

A: A spring arm could work in theory, I’ll give it a test and post my findings.

B: I was actually just about to look into using splines… The only issue is that I can think of this method having is how complex it would become when trying to set it up from road segment to road segment since they are spawned and destroyed quite frequently.

C: Another way that I’ve been looking at is using Floor to flatten the value and then using Rinterp to smooth the rotation from frame to frame so it wouldn’t stutter when moving at high speeds.

Thanks again for the replies. I’ll post back my findings once I’m finished testing these methods.

After some testing the spring arm worked perfectly and there was no need to test the other solutions… However for people who are hoping to achieve a similar result to the image below just keep in mind that the controlled vehicle is a PAWN not CHARACTER.

CHARACTERS have an inherited parent from the C++ script where as the PAWN doesn’t, meaning I can set the Spring Arm to be the PAWNS parent. This just isn’t possible with CHARACTERS as the parent cannot be modified.

So to conclude this solution only works for PAWNS and not CHARACTERS.

You are talking about inheritance but to be honest, you can attach pretty much anything to everything using the following nodes:

213955-capture.png

And the rules will allow you to control the child’s relative transforms. Nothing should stop you from grabbing the character reference, attaching it to a springarm component of another actor and swinging it around like there’s no tomorrow. :slight_smile:

Also, congrats on solving your issue!

1 Like