Character flings into the air when touched by giant NPC

I have some NPCs that are 4-5 times bigger than the player. The problem is, when they touch the player with enough velocity (not a lot, like falling on player from 2 studs high), player flings into the air with huge speed and flies out of the map. It’s sort of like Skyrim giants if you played it.

I don’t want to turn off collision, because I want them to be able to collide with player

How can I fix this?

P.S. Even tho this is not a scripting issue, this is neither a building, game design or art issue. It is most related to scripting, hence I posted it in this category.

1 Like

You could detect when they fling, and if they do, set their character’s position to a certain point in the map so they teleport back to the map instead of flying out and dying.

Still looking for solutions on this

roblox physics being ronlox physics
no fix to this unless you make giants non collideable

You could try disabling the Ragdoll state from the players’ humanoid.

https://developer.roblox.com/en-us/api-reference/enum/HumanoidStateType
https://developer.roblox.com/en-us/api-reference/function/Humanoid/ChangeState

I have had this issue also, and you simply have to turn off collision and use some math to determine for yourself if players are interacting.

hi late reply here, but i’ve been able to mitigate this issue in my games using the following technique:

set all humanoid parts in NPC to Massless = true
set the HumanoidRootPart in NPC to Massless = false

this ensures there is only one part in your entire NPC which determines the assembly mass

after this: calculate the difference between your character HRP size, and the NPC HRP size, you can do this with code along the lines of

local npcRootPart = NPC.HumanoidRootPart
local characterRootPart = Character.HumanoidRootPart
local standardSize = npcRootPart.Size
local sizeDifference = standardSize/npcRootPart.Size – ratio between sizes

local density = sizeDifference
local props = PhysicalProperties.new(density,1,0,1,1)
npcRootPart.CustomPhysicalProperties = props – apply custom physical properties which uses the density difference to ensure their total masses are the same

this makes every NPC assembly weigh the same as your character, this may still fling sometimes but only as much as players could fling one another in your game without any NPCS

hope this helps

3 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.