So what im trying to do is make it so that the gun is no collisions, but doesnt do as it does in the video, i tried making it collide but you would glitch out and launch and it was still possible to shoot through, how can i fix this? Would raycasting to see if the players head has no obstroctions between it and the muzzle work? (Also the bullet shoots from the muzzle and id like to keep it that way
Cast a ray from the players torso towards the mouse position and see if a ray hits anything except the players character which you should filter out, then if the ray does then simply don’t shoot or shoot and the point of intersection.
From the player’s torso, send a ray towards the mouse position that is where you want your bullet to hit, then see if the ray hit or not.
local Origin = Character.Torso.Position
local Direction = Mouse.Hit.Position - Origin
local ray = workspace:RayCast(Origin,Direction,Params?)
if ray then return end
took some tinkering and some changes but it works, i just casted a ray from the torso to the muzzle and if it doesnt meet or there is a part blocking it (Like you showed) it will just shoot the part it hits instead of through the wall. thanks for your help!