Hi, I’m making a simple game where the character is walking on this giant sphere that looks like a planet. But would like your help on how can I make it so that when the character walks in a certain direction of the sphere, he doesn’t fall off but instead just keeps walking all around on it? I realize this might take some physics modifying, which isn’t really my strength, so any help would be appreciated.
Hi ažman,
It seems to me that you need to modify or create a custom movement component.
From my own experience, building a custom movement component is not a simple task, its quite complicated and there is little help on the internet (again, my experience).
I suggest you look into extending the default UCharacterMovementComponent, more precisely implementing a custom move mode.
C++:
/**
* Actor's current movement mode (walking, falling, etc).
* - walking: Walking on a surface, under the effects of friction, and able to step up barriers. Vertical velocity is zero.
* - falling: Falling under the effects of gravity, after jumping or walking off the edge of a surface.
* - flying: Flying, ignoring the effects of gravity.
* - swimming: Swimming through a fluid volume, under the effects of gravity and buoyancy.
* - custom: User-defined custom movement mode, including many possible sub-modes.|
* This is automatically replicated through the Character owner and for client-server movement functions.
* @see SetMovementMode(), CustomMovementMode
*/
UPROPERTY(Category=Character Movement: MovementMode, BlueprintReadOnly)
TEnumAsByte<enum EMovementMode> MovementMode;
As you can see from the code of UCharacterMovementComponent, this MovementMode property allows for a custom mode. I think this is a good point to start.
PS. I’m also new to UE so take my advice with a pinch of salt
I appreciate the help bro, but I work with blueprints and am quite bad with C++.
I have a friend (who’s alright with C++) who tried for several weeks to make something like this, and then gave up. Unreal really wants Z to be “up.”
You might have better results if you rotate the world when the character moves instead. (You’ll also need to rotate anything anchored to the world. Scene graph hierarhcy might help, or might not.)
(Also, all other things in the world will have to simulate as if they know what “down” is, not use the Unreal physics engine.)
ᴰᵃᵐⁿ, sorry to hear that. I’ll try for a bit to see it for myself, but we’ll see.