Hey Developers,
How would I prevent this gun from going though walls (apart from making the wall thicker) and make it so that when a player walks up to the wall they would not be able to put the gun though the wall?
Hey Developers,
How would I prevent this gun from going though walls (apart from making the wall thicker) and make it so that when a player walks up to the wall they would not be able to put the gun though the wall?
You have to enable collsion if you want it to stop, hmu if it doesn’t satisfy you!
thanks for replying, I tried out enabling collision but it still isn’t working?
What is it? Model, mesh or union?
Is CanCollide on the wall set to true?
a Union inside a tool
the wall and the gun both have cancollide set to true
Okay, I can’t help you any further! I don’t have any knowledge in this field.
Check the CollisionGroupIds of both the wall and union. Are they both set to 0?
workaround: make the wall thicker, or add a thicker transparent part with collision on
weld a part to the player’s hand the width of the tool
I have a few ideas in mind.
Hopefully one of these methods will help you out. I’ve never really tried doing this myself but, I’m sure you will find a solution.
This is a hard solution, but can look good.
Raycast from the arms position in the direction of the gun.
If the raycast hits a wall, make the character put the gun up or down and preven him/her from firing.
Have you looked to see if the gun is CanCollide on when you Test it in Studio? Make sure you check the tool in the Character (your avatar name) in the Workplace, not in the Players folder.
How big is the Handle’s Mesh? If it is a tiny .2x.2x.2 Part That may be the issue. If they aren’t the same size try making the Handle physically match the size of the visual gun.