Idk if "radial force" was a component a year ago... but it seems to work great for gravity applied by an object, you should look into it Matt. A quick explanation of how to use it: create planet, add "radial force" component and make it apply a negative impulse, and apply that impulse over event tick, (may also need a negative force [I had hoped that it would work without supplying impulses, but that doesn't seem to be the case]) then all you need is a big enough radius, which is easy enough to make dynamically proportionate to the planet's radius! Great tutorial btw, they really help!
I think the problem why you can't control the rotation of a character blueprint class is because the character blueprint class has a Capsule Component as top level element and in viewport under the 'transform' tab the only option is to change the scale. When you create a pawn from scratch your top level element will be a Default Scene Root and if you put a Capsule Compnent within this scene root it then can be rotated as you wish. As soon as you delete the Default Scene Root from your Pawn you no longer can rotate that Capsule Component.
OMG.... Fantastic tutorial Matt! do you think this might work with a Character BP and its walk animation in the future, or it´s impossible with current Unreal update? well i´m going to try... this tutorial it´s just spectacular.
I gave it a shot and ran into some trouble. I used a custom character BP with camera hooked up much the same way as in this tutorial. But he camera kept turning suddenly when transiting the globe vertically (in world space). I don't know why this would happen or how to fix it. Second getting the walking animation working is going to take a bit of doing (but should be possible). The character won't be in the "walking" state on the planet because the maximum walkable angle is in world space (and to change would require an engine level change). This means the character will be in either the falling or flying state. Getting the animation to work would probably require hooking up motion in the flying state to the animation. Haven't tried that myself.
If the only problem you had was the camera, but walk animation did work right for back, right, left etc, then maybe you could have a second camera without spring arm, and this camera could switch every time you touch a planet... i haven´t try this, but i think the problem by using a pawn is the lack of a movement component, that´s why a character its way better option, try a camera without spring arm and maybe ther is another way to simulate the same effect that spring arm does.
Hi Matt! I've made my own character controller similar to this (first in unity, then in unreal, as I transitioned to unreal). It's been nagging me in the back of my head to use c++ (daunting, scary) instead of blueprints for it, because of how everyone is like DON'T DO TICK IN BLUEPRINT IF YOU CAN HELP IT. Have you found if this even matters on a larger scale? If 200 custom capsules are running around a planetoid, does it have a larger performance difference vs 200 characters running around on the ground with a regular CharacterMovement component?
I am not a 100% sure why everyone is avoiding event tick, but I believe it to be optimization, since it fires even though it might not be relevant in some situations A good alternatives are timelines, you can make them loop, which is essentially like event tick, but you have the option to turn it off when its not needed
AWESOME TUTORIAL!!! can you explain how to limit the jumping to to 1 jump until you land ... I'm also having a bit of jitter after landing while moving ... hoping you could explain how to work around these issues.. thnax in advance!
Gonna try this, thank you. I am interested if this is workable for flying vehicle that could level itself to made up "planet". Thank you for sharing this tutorial. When I try some tests, I will posts how it went for me ;-)
Hello Matt, all right? I have a problem, whenever I keep the walk button pressed, it just starts to go up and off the planet, I have no idea how to fix this...
Hi, loved the tutorial, but I do not know why i have been reaching escape velocity. Tried using a clamp but it did not do anything. You have some idea on why is it happening?
when you set up the controls, moving forward and moving to the right are essentially the same except of the get vector node right? somehow I cant get it work, only forward works This is such a simple thing, I have no idea what could be wrong, its literally copy n paste
Same. I think each new set physics velocity you add overrides the last one. At least that's what happening with me. If I remove the gravity part I can move forward and backward but not sideways, if I remove forward movement I can move sideways then, but if I put forward back sideways stop again.
when i go past the equator the directions flip because of the negative(?). How do I get my camera to stay oriented z down as well? just repeat for camera?
I want to make a planet sized map using height maps but I can't find a tutorial. I can add gravity at later I'm just trying to figure out how to make a full-scale planet. I only need one.
A particularly difficult task considering clamping speed/rotation is typically done from the world frame of reference rather than the frame of reference of the planet. Made even worse if the planet is rotating. I've never come up with a perfect solution, but a good start is to: 1) grab the surface location below the pawn on the surface of the closest planet 2) set a scene component object at the hit location and attach it to the planet 3) save the world location of the scene component as a vector 4) on the next frame grab that scene components new vector and compare to the last to get the instantaneous tangential velocity of the surface of the ground below you. 5) use that tangential velocity as a frame of reference to calculate velocity max etc in any given direction 6) move the scene component to directly below you again, rinse and repeat 1-6
It's really hard to debug without seeing the issue and looking at the code but my guess would be that some rotation that should be applied around one axis is being applied around another.
@@matttaylor4803 I've fixed it. Just turned up Linear and angular Damping in my pawn's mesh. Must say - This tutorial is very helpful! I'm making a survival game where you are on a very small moon (very small, around house sized) and you have to get off of it
Maybe something like: Break the relative rotation and remake it and when doing so: Set the value for the axis in question to the min of what it was or the max value you want for the limit. Make sure you use relative rotation.
It should work but I would not use the landscape itself as the gravitational object. But you can probably wrap a planet in a deformed landscape and have it work.
I added this script to a pawn and it worked fine. But it is not working for the AI.. can you help me with how to add this same gravity to AI and make it chase the player.
You probably will have to write your own nav mesh code and implement a version of an AI algorithm (A* etc.) using 3D space. I'm not sure if UE4's Nav stuff is going to work for the surface of a square. Conversely you could do something out of the box like map the points of the surface of a sphere to a flat plane and then have a marker for where your character is on the planet on the plane and have the AI navigate on the plane and then map their position back to the BP on the planet.... No matter what it will be a lot of trial and error work (unless UE has something I'm unfamiliar with).
Can you make a tutorial please where you can show how to create planet with UE4 Landscape tool? Static mesh are not useful - we need Planet made out with UE4 built in Landscape tools - that makes possible to use splines, auto materials, foliage painter and even sculpt easy manually and etc good stuff - but static mesh cannot do all these things! Please make tutorial for planet creation with UE4 Landscapes!!!
I have a first person camera attached to my pawn, and when I am on the surface, it jitters quite badly. Is there a step I missed, or a way to stop the jitter?
Idk if "radial force" was a component a year ago... but it seems to work great for gravity applied by an object, you should look into it Matt.
A quick explanation of how to use it: create planet, add "radial force" component and make it apply a negative impulse, and apply that impulse over event tick, (may also need a negative force [I had hoped that it would work without supplying impulses, but that doesn't seem to be the case]) then all you need is a big enough radius, which is easy enough to make dynamically proportionate to the planet's radius!
Great tutorial btw, they really help!
Yeah I honestly thought this is what would be used, glad it exists now!
thank you for sharing this, its really hard to find a tutorial that is somewhat recent and this definetly helps
@@thegreendude2086 Your welcome! Good luck with your projects!
Five years later this saved me, thank the heavens!
Great tutorial, works fine on a perfect sphere. though I'm trying to set this up with a more uneven planet terrain and having no luck.. :/
Reminds me of Brackeys ludum dare entry. Nice tutorial! Thank you!
same
100 likes. I found reaaly good and simply implemented gravity orientation. Thanks a lot for sharing yours experience
I think the problem why you can't control the rotation of a character blueprint class is because the character blueprint class has a Capsule Component as top level element and in viewport under the 'transform' tab the only option is to change the scale. When you create a pawn from scratch your top level element will be a Default Scene Root and if you put a Capsule Compnent within this scene root it then can be rotated as you wish. As soon as you delete the Default Scene Root from your Pawn you no longer can rotate that Capsule Component.
You could make your own "landed" state by using a line trace or by adding a collision component to check it you are on a surface.
Thank You so much, I have looked for documentation for this for years!!
Просто лучший!!!
Спасибо большое за урок, раскрыл глаза мои!!!!
still work on ue 5.0.3. i just change some values, like linear dumping
This works great on ue4, but it would be cool to see it on ue5 :3
OMG.... Fantastic tutorial Matt!
do you think this might work with a Character BP and its walk animation in the future, or it´s impossible with current Unreal update? well i´m going to try... this tutorial it´s just spectacular.
I gave it a shot and ran into some trouble. I used a custom character BP with camera hooked up much the same way as in this tutorial. But he camera kept turning suddenly when transiting the globe vertically (in world space). I don't know why this would happen or how to fix it.
Second getting the walking animation working is going to take a bit of doing (but should be possible). The character won't be in the "walking" state on the planet because the maximum walkable angle is in world space (and to change would require an engine level change). This means the character will be in either the falling or flying state. Getting the animation to work would probably require hooking up motion in the flying state to the animation. Haven't tried that myself.
If the only problem you had was the camera, but walk animation did work right for back, right, left etc, then maybe you could have a second camera without spring arm, and this camera could switch every time you touch a planet... i haven´t try this, but i think the problem by using a pawn is the lack of a movement component, that´s why a character its way better option, try a camera without spring arm and maybe ther is another way to simulate the same effect that spring arm does.
excellent video, thank you
Hey nice tutorial thx for that!
But after taking a few steps on my Planet im always starting to take off, can someone tell me whats wrong pls?
Hi Matt! I've made my own character controller similar to this (first in unity, then in unreal, as I transitioned to unreal). It's been nagging me in the back of my head to use c++ (daunting, scary) instead of blueprints for it, because of how everyone is like DON'T DO TICK IN BLUEPRINT IF YOU CAN HELP IT.
Have you found if this even matters on a larger scale? If 200 custom capsules are running around a planetoid, does it have a larger performance difference vs 200 characters running around on the ground with a regular CharacterMovement component?
I am not a 100% sure why everyone is avoiding event tick, but I believe it to be optimization, since it fires even though it might not be relevant in some situations
A good alternatives are timelines, you can make them loop, which is essentially like event tick, but you have the option to turn it off when its not needed
AWESOME TUTORIAL!!! can you explain how to limit the jumping to to 1 jump until you land ... I'm also having a bit of jitter after landing while moving ... hoping you could explain how to work around these issues.. thnax in advance!
Amazing!
Gonna try this, thank you. I am interested if this is workable for flying vehicle that could level itself to made up "planet". Thank you for sharing this tutorial. When I try some tests, I will posts how it went for me ;-)
Hey! This works great, but I want to use a skeletal mesh. And if I use one, it doesn't work anymore. any tips for that?
Thank you man !!! You can help me !!!
How do I apply this series in UE5.2? I've encountered some unsolvable problems.
Hello Matt, all right? I have a problem, whenever I keep the walk button pressed, it just starts to go up and off the planet, I have no idea how to fix this...
Hi, loved the tutorial, but I do not know why i have been reaching escape velocity. Tried using a clamp but it did not do anything. You have some idea on why is it happening?
when you set up the controls, moving forward and moving to the right are essentially the same except of the get vector node right?
somehow I cant get it work, only forward works
This is such a simple thing, I have no idea what could be wrong, its literally copy n paste
I cant moving my mesh :(
Same
Same. I think each new set physics velocity you add overrides the last one. At least that's what happening with me. If I remove the gravity part I can move forward and backward but not sideways, if I remove forward movement I can move sideways then, but if I put forward back sideways stop again.
@@rodrigoxavier3222 Set the "Set Physics Linear Velocity" to "Add to Current" to Yes.
You can use ninja character asset
when i go past the equator the directions flip because of the negative(?). How do I get my camera to stay oriented z down as well? just repeat for camera?
dont know why it doesn't work for you, but for 3rd person it works in new game mode, maybe its cause im using unreal 4.20
Hello, I was wondering if anyone has found a way to combine this with the VRExpansion plugin?
THANK YOU MAN !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
how can we make a pawn walk up and around a cube without falling?
I want to make a planet sized map using height maps but I can't find a tutorial. I can add gravity at later I'm just trying to figure out how to make a full-scale planet. I only need one.
Everything works but my camera does weird things. Is there any way you can upload the project to github, please?
How to show how to swipe lane on this planat like Endless runner ?
Please do this in Unreal Engine 5, this doesnt work anymore
i can't move / i just can move my player camera
is it because the update? / 2 years
Help me plz
Hey Matt, love your tutorials. Im trying to apply this to a game Im working on, but my character spins around like crazy! Any idea why?
if it still matters to you, 18:40 may have been your issue.
awesome tutorial... I tried to replicate this on UE5 with no success.. any chance you're going to make an updated version?
Possibly. I've actually started messing around with a more generalizable version of the thing. We'll see how much time I have.
ive done it three times now, step by painful fucking step - no dice
doesnt seem to work
How would i go about clamping the speed and rotation of the pawn?
A particularly difficult task considering clamping speed/rotation is typically done from the world frame of reference rather than the frame of reference of the planet. Made even worse if the planet is rotating.
I've never come up with a perfect solution, but a good start is to:
1) grab the surface location below the pawn on the surface of the closest planet
2) set a scene component object at the hit location and attach it to the planet
3) save the world location of the scene component as a vector
4) on the next frame grab that scene components new vector and compare to the last to get the instantaneous tangential velocity of the surface of the ground below you.
5) use that tangential velocity as a frame of reference to calculate velocity max etc in any given direction
6) move the scene component to directly below you again, rinse and repeat 1-6
@@matttaylor4803 Thank you so much :)
My physics seems to be broken - whenever i walk i spin around in a circle at an increasing pace with no way to stop it.
sounds like my life in a nutshell
It's really hard to debug without seeing the issue and looking at the code but my guess would be that some rotation that should be applied around one axis is being applied around another.
..sounds like my life in a nutshell
@@matttaylor4803 I've fixed it. Just turned up Linear and angular Damping in my pawn's mesh. Must say - This tutorial is very helpful! I'm making a survival game where you are on a very small moon (very small, around house sized) and you have to get off of it
is there any way to limit the camera's rotation on the y axis ?
Maybe something like:
Break the relative rotation and remake it and when doing so:
Set the value for the axis in question to the min of what it was or the max value you want for the limit.
Make sure you use relative rotation.
How did you open up world settings at 1:12??? I only have details.
lol foudn the old comment. i figured it out tho
my Jumping doesn't work? );
Can we add a landscape to the planet?
Not easily. I'd recommend modeling a landscape for a sphere outside UE and bringing it in. Foliage is also difficult.
@@matttaylor4803 youtu.be/zDLks
i just wanna know, how did he do it?
I got it working, however the rotation wont update when moving across the planet, what can I do?
agrega la rotación del planeta al actor
Heyyyyyyy UsualSpace! It's such a small world :)
@@PolyStylized hey you!
landed on the planet but bounces me infinitely after jumping.
built in jello physics
does this works for a regular landscape?
It should work but I would not use the landscape itself as the gravitational object. But you can probably wrap a planet in a deformed landscape and have it work.
I added this script to a pawn and it worked fine. But it is not working for the AI.. can you help me with how to add this same gravity to AI and make it chase the player.
You probably will have to write your own nav mesh code and implement a version of an AI algorithm (A* etc.) using 3D space. I'm not sure if UE4's Nav stuff is going to work for the surface of a square.
Conversely you could do something out of the box like map the points of the surface of a sphere to a flat plane and then have a marker for where your character is on the planet on the plane and have the AI navigate on the plane and then map their position back to the BP on the planet....
No matter what it will be a lot of trial and error work (unless UE has something I'm unfamiliar with).
@@matttaylor4803 Thank you for the reply.... I'll try what you told.
Can you make a tutorial please where you can show how to create planet with UE4 Landscape tool? Static mesh are not useful - we need Planet made out with UE4 built in Landscape tools - that makes possible to use splines, auto materials, foliage painter and even sculpt easy manually and etc good stuff - but static mesh cannot do all these things! Please make tutorial for planet creation with UE4 Landscapes!!!
I have a first person camera attached to my pawn, and when I am on the surface, it jitters quite badly. Is there a step I missed, or a way to stop the jitter?
@ProVenatus I managed to mitigate it by doing some clever line tracing tricks to create my own "on the ground" mode.
@@LittleBlue42 With the line trace did you change the velocity or the rotation?
Dont work