Download

Please help me create my simple cube pawn

Hi,
My name is Pierre i’m from south of France, i’m quite new into game dev and c++, and with a friend we wanted to make a simple game.
Simple basics are that we want a cube with special abilities and who can transform into other mesh lige balls or triangles on his way.

For this my first problem was the ThirdPersonCharacter BP, no matter what i do, i cannot setp the skulletal mesh as collision, it’s always a capsule. I hate this.
So i had to create my own pawn from scratch.
I went to multiple tutorials on the internet and here is what my pawn look like right now

(This is the link to a .rar who contain 3 .uasset from my personnal dropbox)

So i have my custom Pawn, a move component, and physicmaterial.
If you want to try it, be sure to open custom pawn and add movecomponent then replace the static mesh by a cube.

So if you try you will immediately see what are the problems,
My pawn has a weird vibration everytime i push a moving command.
It’s sliding weird on slopes…

It’s been 1 week and i can’t find any solution.

What i need is a cube who can

  • move forward and backward
  • Strife right and left
  • Rotate
  • Jump

What i saw that need improvement

  • Don’t slide on slope (only very hard slopes)
  • Stop doing anything if no controls are pushed
  • Rotate camera around it without it moving

I would really like if someone could help me solve this, it’s been 2 month i’m working on this and i’m stuck i need personnal help…
Thanks !

I assume you don’t really want a cube as your collision - that’s why you’re getting weird vibration from the friction. This is generally why people use capsules for controllable players.

For an easier time, I’d recommend going with the third-person character template. If you want to ‘remove’ the capsule collision, set its radius and half-height to a very small number so that it’s inside of the mesh and won’t interact with other pieces. Then attach a new collider to the capsule and set it up how you want. This will accept the new collider as the de-facto collision shape for the pawn. Just make sure its collision and physics presets are identical to that of the capsule.

Setting up your own character-like pawn is a huge undertaking, one fraught with time-sinking frustration and you may never really get it to do what you want. It’s almost always a better option to retrofit and work around the pre-built solutions.

Hello,
Thank you for you kind answer,

i WANT a cube as a collision, or anything else but capsule component.
Setting up my own pawn permit me to set a static mesh as collision, third person bp wont accept anything else but capusle component as collision…

let me demonstrate
Here, my cube can fit because collision is equal to the limit of the cube (static mesh)
If i replace the third person character bp skuletal mesh with the same cube, it will half fall trough anyobject because all surface will only take in consideration the capsule, not the cube.

I heard that you said attach a new collider to the capsule but you lost me there :stuck_out_tongue: Caption

Looks like I was mistaken! You can’t add any other collision that affects navigation on a character.

What you can do however is adjust the radius and height such that it is the same size as your cube.

This will of course mean that you can rotate your mesh into walls a bit, but it will save you a lot of time trying to work with a base pawn class. It depends on how precise you want to be with that collision.

If you do need to be more precise, look into using a box trace the same size as your character box that will push the player in the opposite direction when the box is penetrated.

Actually this is still not what i’m looking for, because simetimes the cube has to stresh on the right and left side while upper and lower side stay the same, it basically become a rectangle, in this case, capsule component cannot be adjusted like this. This is why i need my own pawn with static mesh collision.
I just don’t want the capsule collision to be the main collider. i need it to be the skeletal mesh or a static mesh that the player can control.

Please help ^^

Is your pawn, a physics actor?

My pawn is a static mesh - a cube

Here is one solution, but with some problems in ramps.

I went with a cube with physics and a floating movement component. Is this a good idea? Idk.

It has the same configuration and controls as the third person characters, with some modifications.

](filedata/fetch?id=1772256&d=1591460397)

](filedata/fetch?id=1772257&d=1591461192)

In the class defaults:

6.jpg](filedata/fetch?id=1772261&d=1591461209)

Camera movement and cube rotation:

](filedata/fetch?id=1772258&d=1591461209)

](filedata/fetch?id=1772260&d=1591461209)

Keep the cube upwards:

](filedata/fetch?id=1772259&d=1591461209)

PS: personally I don’t like this solution. It’s to messy.

Hey thank you for your help, actually this could work, but there is always the same problem, when i use pre-made components collision don’t work anymore.

Actually my capsule collision doesn’t exist it has 0 per 0 size. All colisions are on my static mesh.

This is driving my crazy, this is why i made a custom pawn, because no matter what i do on third person bp, on character bp or everything that is made by unreal by default, i can’t ever have collision on my mesh, it’s always on this fu**** capsule component…