Player controlled movement restricted to a circular path?

I’m new to Unreal Engine 5 and not sure how to word this question entirely. Essentially I want to create something similiar to how a Sidescroller operates, but instead of it following a straight line, such as start to finish, I want it to loop in a circle. I’ve found something similiar online in regards to this with people using splines to move actors, sometimes pawns, but so far this has all been for UE4.

Any assistance is appreciated! Thank you! I can provide more details and clarity if needed!

1 Like

You can make them follow a spline, or re-code the moment.

Whether you use Pawn or Character as the parent class, you get to write ( or change ) the movement yourself.

So you can code the player to always walk/run in a circle.

I hacked a circular third person

circle

1 Like

This is excellent news, now I know my idea can work for sure! I’m gonna see what I can do with this. I spent most of last night watching videos about splines, attaching ‘actors’ to them but nothing controlling movements. But if I’m understanding what your saying properly, its just something that needs to be built onto it! With this hack, I also imagine if I put in the math to make the radius of the circle bigger, I could get a larger run diameter?

I’m still learning and watching a lot of tutorial for unreal engine, but I haven’t seen much for blueprints, or anything much in regards to what you’ve posted in the screen shot above. As a last request, do you have any specific youtube channel, blog or documentation that you suggest I could read to learn? I’ve got the UE5 doc page book marked and read what I can.

Thanks for taking time to build that up and attach a gif so I could see it working, I appreciate you!

No spline, just player edit.

Yes, just change that number.

I made a copy of the character ( would also work with first person ), and edited the code.

Not really I’m afraid, there is no such thing as Unreal documentation. You just have to find suitable tutorials.

You’re welcome :slight_smile:

1 Like

Epic! Thanks for coming in and confirming everything, have a good rest of your week!

1 Like

@ClockworkOcean Sorry to bring this back up! I haven’t been able to touch project till today and I got it all working for the most part, however character upon keyboard input is teleporting to center of map and falling through, however i can see from the falling animation it is rotating properly so that’s something!

I’m loving this learning experience, but I’m hitting a bit of a wall with figuring out why its doing the teleporting and falling through map behavior.

Is the rotate vector node in your example a default node btw? I can’t seem to find it and google searches lead me to using a “Rotator from axis and angle” leading to “Get rotation x vector” leading to the set actor location, which I think is the culprit… I’m gonna try and upload an image of it but im new to the EDC forum so forgive me if it comes out wrong.

Again, sorry for necroing the post after I marked it solved! Just been busy.

You have to set the ‘center’ variable :slight_smile:

I think it’s a default node

image

Tell me if you can’t find it…

1 Like

I was able to find it. however i’m not quite sure how to use it!

When I look at the example you showed earlier, it looks like its going into an addition node, then a rotate vector that has a vector input and 3 float inputs for the x,y,z. That’s the one I can’t find at the moment, and I went ahead and gave a value to the center variable of 10 on Z. (new users can only embed 1 image at a time so I’ll put the images in order below)

the rest of the blueprint looks like your example, i have this inside the default movement blueprint for thirdperson movement where I removed the default Movement Input and kept the Camera Input and Input Mapping so in total it looks like this. (new users can only embed 1 image at a time so I’ll put the images in order below)

And went ahead and made a quick gif of whats happening when I hit run after compiling. It automatically teleports character right under the map dead in the center when pressing an input key however it is rotating properly lol.

RotateBug

I can’t stress enough how much I appreciate the help on this! you’re awesome XD

CenterRotateVectorThing

so the example rotate vector I was looking for versus this one which I was using, and unsure of how to use the rotate vector you suggested earlier today

and what the total BP looks like to achieve camera control and have input mapping still with the attempted movement change

I don’t get it, too many pictures :slight_smile:

What can’t you do? How far have you got?

1 Like

lmao sorry, i tried to format it to make sense aaah.

I can’t keep the character on the map, its falling through now as soon as I try to move it

Yes, but did you manage to copy my code? ( because if you didn’t, that will probably be why you have a problem… :slight_smile: )

1 Like

Not quite able to copy the code! Your Rotate Vector node is the only thing I wasn’t able to find.

RotateVector

this one, cant seem to find a rotate vector that takes the three floats and inputs/outputs a vector

It’s this one

image

right click

split

1 Like

:sweat_smile: forgive my noobness.

Great, I didn’t realize I could do that… Sorry for the headache I’ll give it a try now.

Learn something new everyday!

1 Like

And… ?

1 Like

So, that fixed a lot of the problems I had! which is excellent. For some reason there is an initial teleport of the character to the outermost radius of the circle but after that it runs in a rotation ALMOST perfectly.

There was an issue where the character was going under the map everytime i tried to move it, however when I added a Z value of 180 to the radius > make vector node, it fixed that issue and its seamlessly running on the map now.

My next problem now is, with me increasing the radius value to 1800 to make it a bigger circle, the character runs super fast now! Also, running backwards has the same animation as forwards but… I can fix that one I think lol
ItsWorking!ItsWOOORRKINNGGG!

But! The most important thing is my original question is now solved which is amazing!

It’s because you’re adding angle with each pulse from the input. As the circle gets wider, that angle takes more space, hence faster. You’ll need to increase the angle more slowly.

Going backwards won’t work, with that setup. That last rotation node, is designed to keep the character with their side facing the center. But when you go backwards, it keeps the same side facing…

To be fair, it was just an initial idea :slight_smile:

1 Like