I would like to disable the maximum walkable floor angle on the movement component. Currently it only allows up to 90 but I would like that not to limit my movement.
If there’s another way to look at walking around on spherical surfaces I would love to hear it. I’ve had to create a class from pawn and ditch the movement component entirely because I can’t find a way of using a character in a spherical world. I’m not a good programmer but at this point I would be willing to entertain the idea of making these changes myself. So where would I start looking in the code to modify the walkable floor angle?
Okay so I’ve built the engine and opened the CharacterMovementComponent.h. In there I found the WalkableFloorAngle and turned it up to 180 on both the Max values - compiled and ran the editor. After all of this it loaded the project selection and I chose my project. It said it was a different version and I could convert it - so I did (Even though the built version of the editor from github is version 4.2 as is the project file because when I updated to the normal engine recently it asked me to convert, so is this something that happens?) Anyhow, on my character class MovementComponent I tried increasing the walkable angle that I changed and it still clamps to 90. How can I either disable the walkable floor angle or increase it beyond 90 degrees. Eventually I’ll want to change this so that the walkable floor angle is relative to the up vector of the character capsule so I can have relative limits.
How does the walkable floor angle work? can I get the character to walk past 90 degrees through modifying the CharacterMovementComponent.cpp? After changing the values that I thought would allow the character to not be limited to the 90 degree angle (and seeing in the editor my value of 180 - changing the walkableZ to -1) I’m confused about how the angle is computed. Any direction would help. Where can I look for modifying either the values that are used in determining this limit or where are the associated methods for this evaluation located?
Looking over the CharacterMovementComponent.cpp I found a method called IsWalkable. I’ve commented out the portions that return false. My max angles are set to 180 yet the character still is blocked at a plane that is more than 90. Where else is it evaluating the movement at?
Not inside the editor, but in the source code CharacterMovementComponent it can be adjusted to whatever.
I think it’s very strange limitation. It must be allowed in blueprints editor graph too. Currently I can’t change this value greater then 90 degrees in BP.
The only solution I was able to work is to rework the entire CharacterMovementComponent in the engine source code. IT’s a lot of work but once you go through and adjust the logic to use a more relative up vector and not “Z” axis only then you don’t need to change the max walkable floor angle past 90 degrees. You evaluate your walkable angle based on your characters up vector and then just manage which way his up vector points.
Do you made your own movement component based on CharacterMovementComponent? Or you changed the original CharacterMovementComponent as engine part?
I trying to write my own movement component which extends character movement component. But after a few days of work I didn’t reach anything.
I just took the original engine CharacterMovementComponent and adjusted it. I’m still kind of getting used to programming in UE4 so I first wanted to proof it out on one that works. To be honest it was a lot of work and if I had more understanding and comfort I’d imagine making your own would be the way to go. It depends on what you’re using it for. There’s a bunch of funtionality throughout the original CMC (jumping, flying, swimming, etc…) additionally there is a lot of stuff you need to move around well (dealing with slide vectors, falling, how to handle collision complications, etc…). So if you’re good with designing those systems up from the ground, I’d say go for it. You could also go through it first and prune out all the stuff you don’t think you’ll need. After I created a method to rotate the logic into the space my character was walking in and also backwards, I had to hit almost every evaluation in the CMC and call my methods to handle that. It’s because they only use the “z” axis to handle so much of it, but if your character is rotated and walking on a wall, then you need to deal with everything differently.