Gun bullets not damaging a sat down character but damages a standing character!

Ok guys here is my problem. I have a gun that uses raycasting. When I click, there is a ray and there is a laser. The laser isnt the one damaging the humanoid. On the position of my mouse, a bullet will spawn and then damage the character. It uses body position to not fall and uses the touched event. The bullet has a stun effect and will make the character sit and fall after it it gets damaged at a certain health. But when the character is seated and falls flat on the ground it cant be damaged by the bullets. It just doesnt register a hit!

Capture when not sitted → https://i.gyazo.com/64b52b53b5acb40edf3960a4343bac91.mp4

Capture when sitted → https://i.gyazo.com/820fc34481de7e850ce91c406accda82.mp4

Note: The two dummies are the same its just that they have different character mesh.

Please tell me the problem!

1 Like

You used the wrong category please change it to #help-and-feedback:scripting-support

1 Like

Have you used the :Sit() function? I have the feeling collissions aren’t really the same when the state is seated

1 Like

I am so sorry! I found out the reason why it is not working. I did not add the damage for when the character is sitting. Now it works. I forgot to script damage for sitting characters! Sorry about that.

EDIT: it is not working, i thought it was fixed

I am still trying to rectify the issue.

I can’t solve without the code

1 Like

Try to add an If statement!
You could also add some print() functions to make sure that hit Is registered and where (you may remove them later if you want) :grin:
Here’s the example below!

if hit.Parent.Humanoid.Sit == false then
print("Humanoid Isn't sitting, damage w/stun effect!")
-- damage code here with the stun effect
elseif hit.Parent.Humanoid.Sit == true then
print("Humanoid Is sitting, damage!")
-- damage code here without the stun effect
end
1 Like

I have done testing and I think what you have said here is true! But the thing is all the rigs ive used and tested are the same(-ish) I copied the player character while in test and pasted it! When i shot it while it was seated it did not work. I tried with another dummy the normal rig that i inserted and it worked. It could get damaged when seated.

Code has been removed in a edit because I have solved the issue.

I went into server mode while testing and disabled the sit for the humanoid, I could then damage it

Ok thanks i found out that when the character is sitting the hit didnt register.

I know this might not be related but when it comes to a character model being anchored it would not register that it died unless the you damage it 2 or more times for it to die. what I would suggest is having a script that detects that its health is below or equal to 0, another solution is manually setting its health other than using Humanoid:TakeDamage()

1 Like

I do not use TakeDamage().But when the humanoid is seated the bullet doesnt damage it.Not on a seat part but the property being ticked.

edit: i fixed it, it was the code