Hello, I’m using the following line trace to simulate gun shot in my multiplayer design with UE5.0.
The line trace can collide with any objects except for the player’s body.
Is there any collision settings that I need to modify to make this work?
The default is to leave this on, which I’d recommend
If you want us to check out the trace, the main thing we need to know, is what’s here
Hello @ClockworkOcean , I put another picture here below to show more info.
In my game, there are up to 4 players and i’m expecting them to shoot each other with line trace.
The bullet trace looks ok, but what is ‘loc end location’ in the other traces?
Are you trying to hit the actual mesh or simply the capsule component? It matters.
For mesh (proper shooter), you’ll need to ignore the capsule. This will require you to create a new object collision channel for the Capsule Component…
Project Settings → Engine → Collision
Next, Edit the capsules collision settings.
Your Traces will now be “Line Trace for Objects”. Add all the Object Types that you want to block the trace, Yet IGNORE the Pawn Capsule.
Hello, @Rev0verDrive ,
As what you guided, I created a PawnCapsule object type and assigned it to Capsule component of my character as illustrated below.
Then, line trace for objects is used to specify which object to block the trace.
But, when the mannequin shot another mannequin in front of him, the line trace still went through his body and hit the ground in front of him(see picture 2). Do I need to change the collision setting of Character mesh?
We trace on the Visibility channel:
Yet we ignore it:
If we use the Visibility channel, the taget must block it (or at least overlap it for multitrace).
We trace for these Objects types:
Yet the desired type is set to something else:
Or am I mixing things up? Didn’t read the whole thread but the above jumps out - would double-triple check that.
The channels and object types are somewhat convoluted, so I’ll leave those 2 here:
Yes. That’s the intention. PawnCapsule type is assigned to Capsule component of Character. The purpose is to let Capsule ignore the line trace and let the skeletal mesh to block the trace.
The object type of skeletal mesh is Pawn. That’s why Pawn is in the list of Make Array.
I am looking for Vehicle
types:
The capsule is a Pawn
type:
The mesh is a Vehicle
. Trace ignores the capsule as its type is not what we’re looking for, hits the mesh instead.
If the capsule was a Vehicle
:
@Everynone , Thanks a lot for your reply. It helps a lot.
I checked again the skeletal mesh I’m using. It’s really strange there is no collision for this skeletal mesh.
I migrated this mesh from LyraStarterGame in market. I double-checked and the collision mesh is good in LyraStarterGame as below. so, something wrong during my migration.
I will fix that first. Thanks for your help!
@Everynone , by the way, do you know how to copy collision mesh of Quinn from LyraStarterGame project into my project?
I don’t even know who these people are ;p I have yet to transition to UE5.
Your Skeletal Mesh Phys Asset needs to have collisions set up. Typically they already do, that’s why I didn’t mention them.