I am trying to add a Static Mesh component to a Character. Every time I add this, the collision is not detected. I have tried many things. I looked on here but the only relevant topic I found was this. However, I’ve seen a couple different responses. I just need to make sure of what I am needing to do for my specific purpose.
In the image above, I’m applying a new mesh to the “NewObjectMesh” component in blueprints, and the collision does not work. I have changed the collision presets multiple times (including “BlockAll”), and nothing has worked. The new mesh, however, renders perfectly fine in the game.
More information is needed.
Is the NewObjectMesh inside of the capsule or does it protrude outside of it?
Can you post a photo of the ENTIRE Blueprint Viewport?
The Character has a custom movement/physics controller, that only pays attention to the root capsule.
This is so that the CharacterMovementController can do all its interpolated magic in networked games.
If you want other colliders to matter, you need to wire them up to the particular behavior you want. Most importantly, just turning on “simulate physics” will not “do it” for anything controlled by a Character pawn.
What do you specifically mean by “wire them up”? Are you implying that I must create a new player blueprint, different from the one currently shown, that works off of its own physics which include the “NewObjectMesh” collider?
If so, by what you are saying, this new blueprint would have an effect to networked games, correct? And if that is true, could I fix the problem without resorting back to the original blueprint?
The “NewObjectMesh” is positioned on the bottom edge of the capsule. Additionally, I use blueprint scripting (along with my C++ code) to change the mesh that is there, with that mesh having a collider set on it.
In the screenshot of the viewport, I have selected the “NewObjectMesh”. It shows its transform, of course, as the bottom edge of the capsule with the axis arrows.
In the event graph (as shown in the screenshot), I am setting its mesh after returning the mesh I need to set it to (this isn’t important but here for context). Next, I disable the collision for both the capsule and the character mesh (which I believe is useless in my scenario since I think it has no collision for the character mesh in the first place). After that, I change the mesh of “NewObjectMesh” that I retrieved earlier. Finally, I set the collision of the “NewObjectMesh” to “Collision Enabled”.
By the way, the code retrieving the new mesh works completely fine. I have even just tried adding an object instead of just changing a blank one.
Is your character supposed to land on something? (Like, a “head-stomp”.)
What is this for?
Disabling the capsule collision, be careful with that. Things can get buggy real quick.
You could have the Character_Capsule channel be ignored, such that the NewObjectMesh is what is registered, but, again, I’m not sure what your purpose is.
Well, I’m not sure if this is what you mean, but the character collision is meant to replace the capsule collision. So, the character’s NewObjectMesh becomes the new capsule.
It is for changing the character to be an object with collision that interacts as you think it would rather than clipping through other objects.
Thank you, that is good to know.
That method, from what you are saying is exactly what I’m looking for. But just to make sure…you are saying the player’s collision would swap from using the capsule collider to the NewObjectMesh’s collider, correct? If so, how would I do this?
Another question, before I respond:
Is the NewObjectMesh supposed to react with EVERYTHING or just certain objects?
Further, you mention that you want to get rid of “object clipping”? Are the legs not sitting atop surfaces correctly? Because, if so, you need to extend the capsule component and/or adjust its position.
PS: Earlier JWATT described “wire them up”… that’s what they meant; isolating collision channels.
It is supposed to react with everything the capsule collider reacts with. So, in a sense, the NewObjectMesh replaces it.
The “object clipping” was in reference to the way the capsule collider would work with the NewObjectMesh collider not working. Everything is sitting as intended. I apologize for the confusion.
Okay, thank you.
No can do. The CharacterMovementController is hard-coded to use the base capsule that is the root component.
You may be able to ignore the character capsule and use another collider for certain cases – for example, hitscan line trace weapons, can test against the mesh (or the skeleton phys asset) instead of the capsule.
But if you want to use character movement component, you have to use the capsule. To use something else, you have to write your own movement component, and base your character on Pawn (add a skinned mesh component) rather than Character.