Is there a way to modify the transparency with SetPlayerColor ?

Hi, I’m trying to create a transparent ragdoll using a player model, but the transparency seems don’t working. This is my code :



local col = Entity(1):GetColor() 
Entity(1):SetPlayerColor(Vector(col.r/255, col.g/255, col.b/255, 0.2))
Entity(1):SetRenderMode(RENDERMODE_TRANSALPHA)
Entity(1):CreateRagdoll()


here the 0.2 (a) doesn’t work.

I’ve alreasy tested with SetColor and it works but the function CreateRagdoll uses the PlayerColor and not SetColor ;
http://wiki.garrysmod.com/page/Player/CreateRagdoll : “The ragdoll will be created with the player’s properties such as Position, Angles, PlayerColor, Velocity and Model.”

The function Vector() does not take 4 arguments.

SetPlayerColor does not support alpha. You’ll have to use SetColor instead.

Thanks for your help but I’ve alreasy tested with SetColor and it works but the function CreateRagdoll uses the PlayerColor and not SetColor

I will make it so that Player.CreateRagdoll will also automatically use the Color and the RenderMode of the player for the next update.

Ok so we can’t currently modify the ragdoll’s transparency ?

You can, manually, via http://wiki.garrysmod.com/page/Player/GetRagdollEntity which is mentioned on the wiki.

Keep in mind that the clientside and serverside GetRagdollEntity are 2 different things and are not synchronized.

Ok thx :slight_smile: