It uses some physics stuff and that didn’t really work for me, so I did my own gravity, movement and stuff, but I got stuck at collision.
I have no idea how to make the movement component detect collision and stop the character’s movement in any other way than … line traces…
Is this a stupid idea?? Should I even try it? It kind of sounds like a logical way to detect collision but I don’t know if it’s worth it.
For context, Im just remaking old 2D sidescrollers for now using 3D models and some perspective, and the default capsule controller thing has been a pain to use as I can’t have a box instead of the capsule. (this is mostly painful when the character is standing on a ledge… among other issues)
I don’t know how to fix your current issue, but if all you want is flat-base ledge mechanics, there is an option for that in the character movement component that comes with the regular UE character:
Wow I cant believe I haven’t seen that option before! I wonder if it’s a new thing … Anyway, I guess I should use that for the ground collision and use a separate box collision for walls / ceilings, as the capsule shape really is annoying to work with.
Thanks ! I will try to create my own template BP for this.
I’d still be interested in finding some answer if the line trace solution would be completely insane or not, but I’ll ask in other places too.
Putting other collision inside a blueprint doesn’t usually work, unfortunately. The engine usually only accepts the root component’s collision for the entire blueprint.
However, you may be able to fix this if you just make the capsule component no longer the root and put a box component as the root instead.
I believe the root removing function is something like “DetachFromRoot()” but I don’t remember the exact name. It might look something like this:
GetCapsuleComponent()->DetachFromRoot();
RootComponent = YourBoxCollisionHere;
Edit: I checked. I can’t find “DetachFromRoot,” so I must have the name wrong. But, am absolutely certain there exists a function that makes the root component no longer the root component and allows you to make something else the root component. I don’t believe simply setting “RootComponent = xyz” works without using the root removing function on the capsule first, but maybe you could try that.