Hi guys, I want to create a walking lizard , I animated it in 3ds max , then made it walk but using the Character BluePrint class , then I realized that it inherits a capsule collision component which is good for vertical characters , but in my case lizard is horizontal((as you can see , capsule is not a good solution)
I need a controller to control the pawn? So i need to make a BP Controller class and set the controls there and posses my pawn, ok, but how to do that? My pawn BP is set to auto possess player 0, and another problem is how to set up the movement input in the Controller blueprint?
I think it sounds like a big mess out there , thanks anyone for the help.
Hey well the character is setup this way it inherits a capsule collision component and instead of redoing all this from pawn class you could just reduce the size of the capsule collision to be a sphere and make it in center of your character, you can also turn off collisions on it. Then add another collision like you tried with the Box, this can also be done using physics asset.
■■■■! Feeling like an idiot Will try that as soon as I go back home , after 3-4 hours! Thanks for the answer , will update when I try it.
Ok, so i scaled the capsule made it really small , but if i turn off collisions for it , my character falls , so i let them on and added a box component,but with that box (collision preset Pawn or block all , or anything else) that box don’t collide with static meshes(collision preset- block all).
Yeah I tried that and I got same results, even if I add another Capsule Collision or anything, it only works with overlap events and such, but not collision. Weird. Capsule is the base of the character and character mesh is attached to the capsule, I checked Shooter example and it has same system, the Capsule is set to collide and the mesh too but in game only the capsule collides with environment. It makes sense cause this is a simple way of making this work, and much better than having boxes and different shapes to define collision. Then I checked the PlatformerGame example, and here is a screenshot, same thing the capsule is used for collision and the character is positioned behind the capsule, this way it can detect which animation to play, just before the real character hits the spot, for example , climbing a ledge, dropping off a ledge, hitting the wall, etc. So looks like this is the proper way of doing this.
If you think about it this could easily look wrong, if for example there would be some StaticMeshes on ceiling, and the character would jump so that Capsule would miss the ceiling but the mesh wouldn’t, then that would look bad, so it’s also up to level design to hide such things. Think about it if you can make the Capsule work for you in some way, maybe just make it big enough to cover most of the body, the most obvious problem would then be if the lizard would be jumping. Another thought I have is “why wouldn’t we just replace the capsule with the box” in C++ character class ? I really didn’t expect this to be such a puzzling question , I’ll keep thinking about it…
If was able to do it I would do it. We are having a capsule , because our characters are using “Character BluePrint Class” and it"s root is a capsule.If we want different root , we must use let’s say a Pawn , but a Pawn doesn’t have MovementComponent and this where it gets complicated , at least for me.
I agree yes, if you’d use Pawn you’d need to remake the whole movement logic, which is rather complicated, I just checked the “character.cpp” class, and it simply has a Capsule Component set up at the start and it’s also used in some of the functions and movement system, so it would seem changing this to a Box Component and update the correct functions would do the trick,
but this still requires some time and coding. I don’t know what else to suggest here, easiest way would be to just make it work with this Capsule, another trick would be to use bigger collisions on your environment meshes.
Well I actually have same problem with one of my projects, cause my character is a frog, but it’s side scroller so my problem is solved same way like on that screenshot, I just positioned the Capsule in front of character and I’ll make the environment so that no collision on the mesh won’t be noticed. I already have a ledge climb system too and it seems to work fine this way.
I could try changing Capsule to a Box Component in code, but I don’t have the full source code installed, and just installing that would take me the rest of the day…
I agree, well I hope someone else sees this questions and enlightens both of us with a simple solution. As I said I will keep this in mind. Did you try to make this work using physics asset?
A nice example would be vehicles, I just tried this with my frog character and it all worked including animation, except the frog then didn’t move with the capsule :(. Ah well, obviously this can be done with physics assets just need to figure it out.
Here’s a useful video on PHAT and blending physics assets with animation.
Ok, so here Blueprint Creating a Tank | Live Training | Unreal Engine - YouTube
the guy is making a tank , which is different , but the point is that he is making it from a pawn, and he is using “Add Actor Local offset” to make it move and i think that if i can get that offset and somehow make that offset to change the value of my variable Speed(which I am using in my AnimBP, to blend between walk and idle animations), maybe that can do the trick, but since i am new i can’t casting to another blueprint to work , so i can read my variable Speed , which is set in another blueprint.(my “AnimBP”).
I ended up making the Collision object for my static meshes a lot bigger than the actual meshes and now the collision happens before my lizards “enters” in the mesh , some sort of a workaround, but i guess not going to work for more complex projects.