This provides a default material with a wide variety of rendering features and properties without the need to write shader code. See the tutorial below for details.

Constructor

@:native("new")new()

Variables

@:native("AlbedoColor")albedoColor:Color

The material's base color.

@:native("AlbedoTexture")albedoTexture:Texture

Texture to multiply by godot.SpatialMaterial.albedoColor. Used for basic texturing of objects.

@:native("Anisotropy")anisotropy:Single

The strength of the anisotropy effect. This is multiplied by godot.SpatialMaterial.anisotropyFlowmap's alpha channel if a texture is defined there and the texture contains an alpha channel.

@:native("AnisotropyEnabled")anisotropyEnabled:Bool

If true, anisotropy is enabled. Anisotropy changes the shape of the specular blob and aligns it to tangent space. This is useful for brushed aluminium and hair reflections.

Note: Mesh tangents are needed for anisotropy to work. If the mesh does not contain tangents, the anisotropy effect will appear broken.

Note: Material anisotropy should not to be confused with anisotropic texture filtering. Anisotropic texture filtering can be enabled by selecting a texture in the FileSystem dock, going to the Import dock, checking the Anisotropic checkbox then clicking Reimport.

@:native("AnisotropyFlowmap")anisotropyFlowmap:Texture

Texture that offsets the tangent map for anisotropy calculations and optionally controls the anisotropy effect (if an alpha channel is present). The flowmap texture is expected to be a derivative map, with the red channel representing distortion on the X axis and green channel representing distortion on the Y axis. Values below 0.5 will result in negative distortion, whereas values above 0.5 will result in positive distortion.

If present, the texture's alpha channel will be used to multiply the strength of the godot.SpatialMaterial.anisotropy effect. Fully opaque pixels will keep the anisotropy effect's original strength while fully transparent pixels will disable the anisotropy effect entirely. The flowmap texture's blue channel is ignored.

@:native("AoEnabled")aoEnabled:Bool

If true, ambient occlusion is enabled. Ambient occlusion darkens areas based on the godot.SpatialMaterial.aoTexture.

@:native("AoLightAffect")aoLightAffect:Single

Amount that ambient occlusion affects lighting from lights. If 0, ambient occlusion only affects ambient light. If 1, ambient occlusion affects lights just as much as it affects ambient light. This can be used to impact the strength of the ambient occlusion effect, but typically looks unrealistic.

@:native("AoOnUv2")aoOnUv2:Bool

If true, use UV2 coordinates to look up from the godot.SpatialMaterial.aoTexture.

@:native("AoTexture")aoTexture:Texture

Texture that defines the amount of ambient occlusion for a given point on the object.

@:native("AoTextureChannel")aoTextureChannel:SpatialMaterial_TextureChannel

Specifies the channel of the godot.SpatialMaterial.aoTexture in which the ambient occlusion information is stored. This is useful when you store the information for multiple effects in a single texture. For example if you stored metallic in the red channel, roughness in the blue, and ambient occlusion in the green you could reduce the number of textures you use.

@:native("Clearcoat")clearcoat:Single

Sets the strength of the clearcoat effect. Setting to 0 looks the same as disabling the clearcoat effect.

@:native("ClearcoatEnabled")clearcoatEnabled:Bool

If true, clearcoat rendering is enabled. Adds a secondary transparent pass to the lighting calculation resulting in an added specular blob. This makes materials appear as if they have a clear layer on them that can be either glossy or rough.

Note: Clearcoat rendering is not visible if the material has godot.SpatialMaterial.flagsUnshaded set to true.

@:native("ClearcoatGloss")clearcoatGloss:Single

Sets the roughness of the clearcoat pass. A higher value results in a smoother clearcoat while a lower value results in a rougher clearcoat.

@:native("ClearcoatTexture")clearcoatTexture:Texture

Texture that defines the strength of the clearcoat effect and the glossiness of the clearcoat. Strength is specified in the red channel while glossiness is specified in the green channel.

@:native("DepthDeepParallax")depthDeepParallax:Bool

If true, the shader will read depth texture at multiple points along the view ray to determine occlusion and parrallax. This can be very performance demanding, but results in more realistic looking depth mapping.

@:native("DepthEnabled")depthEnabled:Bool

If true, depth mapping is enabled (also called "parallax mapping" or "height mapping"). See also godot.SpatialMaterial.normalEnabled.

Note: Depth mapping is not supported if triplanar mapping is used on the same material. The value of godot.SpatialMaterial.depthEnabled will be ignored if godot.SpatialMaterial.uv1Triplanar is enabled.

@:native("DepthFlipBinormal")depthFlipBinormal:Bool

If true, direction of the binormal is flipped before using in the depth effect. This may be necessary if you have encoded your binormals in a way that is conflicting with the depth effect.

@:native("DepthFlipTangent")depthFlipTangent:Bool

If true, direction of the tangent is flipped before using in the depth effect. This may be necessary if you have encoded your tangents in a way that is conflicting with the depth effect.

@:native("DepthMaxLayers")depthMaxLayers:Int

Number of layers to use when using godot.SpatialMaterial.depthDeepParallax and the view direction is perpendicular to the surface of the object. A higher number will be more performance demanding while a lower number may not look as crisp.

@:native("DepthMinLayers")depthMinLayers:Int

Number of layers to use when using godot.SpatialMaterial.depthDeepParallax and the view direction is parallel to the surface of the object. A higher number will be more performance demanding while a lower number may not look as crisp.

@:native("DepthScale")depthScale:Single

Scales the depth offset effect. A higher number will create a larger depth.

@:native("DepthTexture")depthTexture:Texture

Texture used to determine depth at a given pixel. Depth is always stored in the red channel.

@:native("DetailAlbedo")detailAlbedo:Texture

Texture that specifies the color of the detail overlay.

@:native("DetailBlendMode")detailBlendMode:SpatialMaterial_BlendMode

Specifies how the godot.SpatialMaterial.detailAlbedo should blend with the current ALBEDO. See godot.SpatialMaterial_BlendMode for options.

@:native("DetailEnabled")detailEnabled:Bool

If true, enables the detail overlay. Detail is a second texture that gets mixed over the surface of the object based on godot.SpatialMaterial.detailMask. This can be used to add variation to objects, or to blend between two different albedo/normal textures.

@:native("DetailMask")detailMask:Texture

Texture used to specify how the detail textures get blended with the base textures.

@:native("DetailNormal")detailNormal:Texture

Texture that specifies the per-pixel normal of the detail overlay.

Note: Godot expects the normal map to use X+, Y+, and Z+ coordinates. See [http://wiki.polycount.com/wiki/Normal_Map_Technical_Details#Common_Swizzle_Coordinates](this page) for a comparison of normal map coordinates expected by popular engines.

@:native("DetailUvLayer")detailUvLayer:SpatialMaterial_DetailUV

Specifies whether to use UV or UV2 for the detail layer. See godot.SpatialMaterial_DetailUV for options.

@:native("DistanceFadeMaxDistance")distanceFadeMaxDistance:Single

Distance at which the object appears fully opaque.

Note: If distance_fade_max_distance is less than distance_fade_min_distance, the behavior will be reversed. The object will start to fade away at distance_fade_max_distance and will fully disappear once it reaches distance_fade_min_distance.

@:native("DistanceFadeMinDistance")distanceFadeMinDistance:Single

Distance at which the object starts to become visible. If the object is less than this distance away, it will be invisible.

Note: If distance_fade_min_distance is greater than distance_fade_max_distance, the behavior will be reversed. The object will start to fade away at distance_fade_max_distance and will fully disappear once it reaches distance_fade_min_distance.

@:native("DistanceFadeMode")distanceFadeMode:SpatialMaterial_DistanceFadeModeEnum

Specifies which type of fade to use. Can be any of the godot.SpatialMaterial_DistanceFadeModeEnums.

@:native("Emission")emission:Color

The emitted light's color. See godot.SpatialMaterial.emissionEnabled.

@:native("EmissionEnabled")emissionEnabled:Bool

If true, the body emits light. Emitting light makes the object appear brighter. The object can also cast light on other objects if a godot.GIProbe or godot.BakedLightmap is used and this object is used in baked lighting.

@:native("EmissionEnergy")emissionEnergy:Single

The emitted light's strength. See godot.SpatialMaterial.emissionEnabled.

@:native("EmissionOnUv2")emissionOnUv2:Bool

Use UV2 to read from the godot.SpatialMaterial.emissionTexture.

@:native("EmissionTexture")emissionTexture:Texture

Texture that specifies how much surface emits light at a given point.

@:native("FlagsAlbedoTexForceSrgb")flagsAlbedoTexForceSrgb:Bool

Forces a conversion of the godot.SpatialMaterial.albedoTexture from sRGB space to linear space.

@:native("FlagsDisableAmbientLight")flagsDisableAmbientLight:Bool

If true, the object receives no ambient light.

@:native("FlagsDoNotReceiveShadows")flagsDoNotReceiveShadows:Bool

If true, the object receives no shadow that would otherwise be cast onto it.

@:native("FlagsEnsureCorrectNormals")flagsEnsureCorrectNormals:Bool

If true, the shader will compute extra operations to make sure the normal stays correct when using a non-uniform scale. Only enable if using non-uniform scaling.

@:native("FlagsFixedSize")flagsFixedSize:Bool

If true, the object is rendered at the same size regardless of distance.

@:native("FlagsNoDepthTest")flagsNoDepthTest:Bool

If true, depth testing is disabled and the object will be drawn in render order.

@:native("FlagsTransparent")flagsTransparent:Bool

If true, transparency is enabled on the body. See also godot.SpatialMaterial.paramsBlendMode.

@:native("FlagsUnshaded")flagsUnshaded:Bool

If true, the object is unaffected by lighting.

@:native("FlagsUsePointSize")flagsUsePointSize:Bool

If true, render point size can be changed.

Note: This is only effective for objects whose geometry is point-based rather than triangle-based. See also godot.SpatialMaterial.paramsPointSize.

@:native("FlagsUseShadowToOpacity")flagsUseShadowToOpacity:Bool

If true, enables the "shadow to opacity" render mode where lighting modifies the alpha so shadowed areas are opaque and non-shadowed areas are transparent. Useful for overlaying shadows onto a camera feed in AR.

@:native("FlagsVertexLighting")flagsVertexLighting:Bool

If true, lighting is calculated per vertex rather than per pixel. This may increase performance on low-end devices, especially for meshes with a lower polygon count. The downside is that shading becomes much less accurate, with visible linear interpolation between vertices that are joined together. This can be compensated by ensuring meshes have a sufficient level of subdivision (but not too much, to avoid reducing performance). Some material features are also not supported when vertex shading is enabled.

See also which can globally enable vertex shading on all materials.

Note: By default, vertex shading is enforced on mobile platforms by 's mobile override.

Note: godot.SpatialMaterial.flagsVertexLighting has no effect if godot.SpatialMaterial.flagsUnshaded is true.

@:native("FlagsWorldTriplanar")flagsWorldTriplanar:Bool

If true, triplanar mapping is calculated in world space rather than object local space. See also godot.SpatialMaterial.uv1Triplanar.

@:native("Metallic")metallic:Single

A high value makes the material appear more like a metal. Non-metals use their albedo as the diffuse color and add diffuse to the specular reflection. With non-metals, the reflection appears on top of the albedo color. Metals use their albedo as a multiplier to the specular reflection and set the diffuse color to black resulting in a tinted reflection. Materials work better when fully metal or fully non-metal, values between 0 and 1 should only be used for blending between metal and non-metal sections. To alter the amount of reflection use godot.SpatialMaterial.roughness.

@:native("MetallicSpecular")metallicSpecular:Single

Sets the size of the specular lobe. The specular lobe is the bright spot that is reflected from light sources.

Note: Unlike godot.SpatialMaterial.metallic, this is not energy-conserving, so it should be left at 0.5 in most cases. See also godot.SpatialMaterial.roughness.

@:native("MetallicTexture")metallicTexture:Texture

Texture used to specify metallic for an object. This is multiplied by godot.SpatialMaterial.metallic.

@:native("MetallicTextureChannel")metallicTextureChannel:SpatialMaterial_TextureChannel

Specifies the channel of the godot.SpatialMaterial.metallicTexture in which the metallic information is stored. This is useful when you store the information for multiple effects in a single texture. For example if you stored metallic in the red channel, roughness in the blue, and ambient occlusion in the green you could reduce the number of textures you use.

@:native("NormalEnabled")normalEnabled:Bool

If true, normal mapping is enabled.

@:native("NormalScale")normalScale:Single

The strength of the normal map's effect.

@:native("NormalTexture")normalTexture:Texture

Texture used to specify the normal at a given pixel. The normal_texture only uses the red and green channels; the blue and alpha channels are ignored. The normal read from normal_texture is oriented around the surface normal provided by the godot.Mesh.

Note: The mesh must have both normals and tangents defined in its vertex data. Otherwise, the normal map won't render correctly and will only appear to darken the whole surface. If creating geometry with godot.SurfaceTool, you can use godot.SurfaceTool.generateNormals and godot.SurfaceTool.generateTangents to automatically generate normals and tangents respectively.

Note: Godot expects the normal map to use X+, Y+, and Z+ coordinates. See [http://wiki.polycount.com/wiki/Normal_Map_Technical_Details#Common_Swizzle_Coordinates](this page) for a comparison of normal map coordinates expected by popular engines.

@:native("ParamsAlphaScissorThreshold")paramsAlphaScissorThreshold:Single

Threshold at which the alpha scissor will discard values.

@:native("ParamsBillboardKeepScale")paramsBillboardKeepScale:Bool

If true, the shader will keep the scale set for the mesh. Otherwise the scale is lost when billboarding. Only applies when godot.SpatialMaterial.paramsBillboardMode is godot.SpatialMaterial_BillboardMode.enabled.

@:native("ParamsBillboardMode")paramsBillboardMode:SpatialMaterial_BillboardMode

Controls how the object faces the camera. See godot.SpatialMaterial_BillboardMode.

Note: Billboard mode is not suitable for VR because the left-right vector of the camera is not horizontal when the screen is attached to your head instead of on the table. See [https://github.com/godotengine/godot/issues/41567](GitHub issue #41567) for details.

@:native("ParamsBlendMode")paramsBlendMode:SpatialMaterial_BlendMode

The material's blend mode.

Note: Values other than Mix force the object into the transparent pipeline. See godot.SpatialMaterial_BlendMode.

@:native("ParamsCullMode")paramsCullMode:SpatialMaterial_CullMode

Which side of the object is not drawn when backfaces are rendered. See godot.SpatialMaterial_CullMode.

@:native("ParamsDepthDrawMode")paramsDepthDrawMode:SpatialMaterial_DepthDrawMode

Determines when depth rendering takes place. See godot.SpatialMaterial_DepthDrawMode. See also godot.SpatialMaterial.flagsTransparent.

@:native("ParamsDiffuseMode")paramsDiffuseMode:SpatialMaterial_DiffuseMode

The algorithm used for diffuse light scattering. See godot.SpatialMaterial_DiffuseMode.

@:native("ParamsGrow")paramsGrow:Bool

If true, enables the vertex grow setting. See godot.SpatialMaterial.paramsGrowAmount.

@:native("ParamsGrowAmount")paramsGrowAmount:Single

Grows object vertices in the direction of their normals.

@:native("ParamsLineWidth")paramsLineWidth:Single

Currently unimplemented in Godot.

@:native("ParamsPointSize")paramsPointSize:Single

The point size in pixels. See godot.SpatialMaterial.flagsUsePointSize.

@:native("ParamsSpecularMode")paramsSpecularMode:SpatialMaterial_SpecularMode

The method for rendering the specular blob. See godot.SpatialMaterial_SpecularMode.

@:native("ParamsUseAlphaScissor")paramsUseAlphaScissor:Bool

If true, the shader will discard all pixels that have an alpha value less than godot.SpatialMaterial.paramsAlphaScissorThreshold.

@:native("ParticlesAnimHFrames")particlesAnimHFrames:Int

The number of horizontal frames in the particle sprite sheet. Only enabled when using godot.SpatialMaterial_BillboardMode.particles. See godot.SpatialMaterial.paramsBillboardMode.

@:native("ParticlesAnimLoop")particlesAnimLoop:Bool

If true, particle animations are looped. Only enabled when using godot.SpatialMaterial_BillboardMode.particles. See godot.SpatialMaterial.paramsBillboardMode.

@:native("ParticlesAnimVFrames")particlesAnimVFrames:Int

The number of vertical frames in the particle sprite sheet. Only enabled when using godot.SpatialMaterial_BillboardMode.particles. See godot.SpatialMaterial.paramsBillboardMode.

@:native("ProximityFadeDistance")proximityFadeDistance:Single

Distance over which the fade effect takes place. The larger the distance the longer it takes for an object to fade.

@:native("ProximityFadeEnable")proximityFadeEnable:Bool

If true, the proximity fade effect is enabled. The proximity fade effect fades out each pixel based on its distance to another object.

@:native("RefractionEnabled")refractionEnabled:Bool

If true, the refraction effect is enabled. Refraction distorts transparency based on light from behind the object. When using the GLES3 backend, the material's roughness value will affect the blurriness of the refraction. Higher roughness values will make the refraction look blurrier.

@:native("RefractionScale")refractionScale:Single

The strength of the refraction effect. Higher values result in a more distorted appearance for the refraction.

@:native("RefractionTexture")refractionTexture:Texture

Texture that controls the strength of the refraction per-pixel. Multiplied by godot.SpatialMaterial.refractionScale.

@:native("RefractionTextureChannel")refractionTextureChannel:SpatialMaterial_TextureChannel

Specifies the channel of the godot.SpatialMaterial.refractionTexture in which the refraction information is stored. This is useful when you store the information for multiple effects in a single texture. For example if you stored metallic in the red channel, roughness in the blue, and ambient occlusion in the green you could reduce the number of textures you use.

@:native("Rim")rim:Single

Sets the strength of the rim lighting effect.

@:native("RimEnabled")rimEnabled:Bool

If true, rim effect is enabled. Rim lighting increases the brightness at glancing angles on an object.

Note: Rim lighting is not visible if the material has godot.SpatialMaterial.flagsUnshaded set to true.

@:native("RimTexture")rimTexture:Texture

Texture used to set the strength of the rim lighting effect per-pixel. Multiplied by godot.SpatialMaterial.rim.

@:native("RimTint")rimTint:Single

The amount of to blend light and albedo color when rendering rim effect. If 0 the light color is used, while 1 means albedo color is used. An intermediate value generally works best.

@:native("Roughness")roughness:Single

Surface reflection. A value of 0 represents a perfect mirror while a value of 1 completely blurs the reflection. See also godot.SpatialMaterial.metallic.

@:native("RoughnessTexture")roughnessTexture:Texture

Texture used to control the roughness per-pixel. Multiplied by godot.SpatialMaterial.roughness.

@:native("RoughnessTextureChannel")roughnessTextureChannel:SpatialMaterial_TextureChannel

Specifies the channel of the godot.SpatialMaterial.aoTexture in which the ambient occlusion information is stored. This is useful when you store the information for multiple effects in a single texture. For example if you stored metallic in the red channel, roughness in the blue, and ambient occlusion in the green you could reduce the number of textures you use.

@:native("SubsurfScatterEnabled")subsurfScatterEnabled:Bool

If true, subsurface scattering is enabled. Emulates light that penetrates an object's surface, is scattered, and then emerges.

@:native("SubsurfScatterStrength")subsurfScatterStrength:Single

The strength of the subsurface scattering effect.

@:native("SubsurfScatterTexture")subsurfScatterTexture:Texture

Texture used to control the subsurface scattering strength. Stored in the red texture channel. Multiplied by godot.SpatialMaterial.subsurfScatterStrength.

@:native("Transmission")transmission:Color

The color used by the transmission effect. Represents the light passing through an object.

@:native("TransmissionEnabled")transmissionEnabled:Bool

If true, the transmission effect is enabled.

@:native("TransmissionTexture")transmissionTexture:Texture

Texture used to control the transmission effect per-pixel. Added to godot.SpatialMaterial.transmission.

@:native("Uv1Offset")uv1Offset:Vector3

How much to offset the UV coordinates. This amount will be added to UV in the vertex function. This can be used to offset a texture.

@:native("Uv1Scale")uv1Scale:Vector3

How much to scale the UV coordinates. This is multiplied by UV in the vertex function.

@:native("Uv1Triplanar")uv1Triplanar:Bool

If true, instead of using UV textures will use a triplanar texture lookup to determine how to apply textures. Triplanar uses the orientation of the object's surface to blend between texture coordinates. It reads from the source texture 3 times, once for each axis and then blends between the results based on how closely the pixel aligns with each axis. This is often used for natural features to get a realistic blend of materials. Because triplanar texturing requires many more texture reads per-pixel it is much slower than normal UV texturing. Additionally, because it is blending the texture between the three axes, it is unsuitable when you are trying to achieve crisp texturing.

@:native("Uv1TriplanarSharpness")uv1TriplanarSharpness:Single

A lower number blends the texture more softly while a higher number blends the texture more sharply.

@:native("Uv2Offset")uv2Offset:Vector3

How much to offset the UV2 coordinates. This amount will be added to UV2 in the vertex function. This can be used to offset a texture.

@:native("Uv2Scale")uv2Scale:Vector3

How much to scale the UV2 coordinates. This is multiplied by UV2 in the vertex function.

@:native("Uv2Triplanar")uv2Triplanar:Bool

If true, instead of using UV2 textures will use a triplanar texture lookup to determine how to apply textures. Triplanar uses the orientation of the object's surface to blend between texture coordinates. It reads from the source texture 3 times, once for each axis and then blends between the results based on how closely the pixel aligns with each axis. This is often used for natural features to get a realistic blend of materials. Because triplanar texturing requires many more texture reads per-pixel it is much slower than normal UV texturing. Additionally, because it is blending the texture between the three axes, it is unsuitable when you are trying to achieve crisp texturing.

@:native("Uv2TriplanarSharpness")uv2TriplanarSharpness:Single

A lower number blends the texture more softly while a higher number blends the texture more sharply.

@:native("VertexColorIsSrgb")vertexColorIsSrgb:Bool

If true, the model's vertex colors are processed as sRGB mode.

@:native("VertexColorUseAsAlbedo")vertexColorUseAsAlbedo:Bool

If true, the vertex color is used as albedo color.

Methods

@:native("GetAlbedo")getAlbedo():Color

@:native("GetAlphaScissorThreshold")getAlphaScissorThreshold():Single

@:native("GetAnisotropy")getAnisotropy():Single

@:native("GetAoLightAffect")getAoLightAffect():Single

@:native("GetAoTextureChannel")getAoTextureChannel():SpatialMaterial_TextureChannel

@:native("GetBillboardMode")getBillboardMode():SpatialMaterial_BillboardMode

@:native("GetBlendMode")getBlendMode():SpatialMaterial_BlendMode

@:native("GetClearcoat")getClearcoat():Single

@:native("GetClearcoatGloss")getClearcoatGloss():Single

@:native("GetCullMode")getCullMode():SpatialMaterial_CullMode

@:native("GetDepthDeepParallaxFlipBinormal")getDepthDeepParallaxFlipBinormal():Bool

@:native("GetDepthDeepParallaxFlipTangent")getDepthDeepParallaxFlipTangent():Bool

@:native("GetDepthDeepParallaxMaxLayers")getDepthDeepParallaxMaxLayers():Int

@:native("GetDepthDeepParallaxMinLayers")getDepthDeepParallaxMinLayers():Int

@:native("GetDepthDrawMode")getDepthDrawMode():SpatialMaterial_DepthDrawMode

@:native("GetDepthScale")getDepthScale():Single

@:native("GetDetailBlendMode")getDetailBlendMode():SpatialMaterial_BlendMode

@:native("GetDetailUv")getDetailUv():SpatialMaterial_DetailUV

@:native("GetDiffuseMode")getDiffuseMode():SpatialMaterial_DiffuseMode

@:native("GetDistanceFadeMaxDistance")getDistanceFadeMaxDistance():Single

@:native("GetDistanceFadeMinDistance")getDistanceFadeMinDistance():Single

@:native("GetEmission")getEmission():Color

@:native("GetEmissionEnergy")getEmissionEnergy():Single

@:native("GetFeature")getFeature(feature:SpatialMaterial_Feature):Bool

Returns true, if the specified godot.SpatialMaterial_Feature is enabled.

@:native("GetFlag")getFlag(flag:SpatialMaterial_Flags):Bool

Returns true, if the specified flag is enabled. See godot.SpatialMaterial_Flags enumerator for options.

@:native("GetGrow")getGrow():Single

@:native("GetLineWidth")getLineWidth():Single

@:native("GetMetallic")getMetallic():Single

@:native("GetMetallicTextureChannel")getMetallicTextureChannel():SpatialMaterial_TextureChannel

@:native("GetNormalScale")getNormalScale():Single

@:native("GetParticlesAnimHFrames")getParticlesAnimHFrames():Int

@:native("GetParticlesAnimLoop")getParticlesAnimLoop():Bool

@:native("GetParticlesAnimVFrames")getParticlesAnimVFrames():Int

@:native("GetPointSize")getPointSize():Single

@:native("GetProximityFadeDistance")getProximityFadeDistance():Single

@:native("GetRefraction")getRefraction():Single

@:native("GetRefractionTextureChannel")getRefractionTextureChannel():SpatialMaterial_TextureChannel

@:native("GetRim")getRim():Single

@:native("GetRimTint")getRimTint():Single

@:native("GetRoughness")getRoughness():Single

@:native("GetRoughnessTextureChannel")getRoughnessTextureChannel():SpatialMaterial_TextureChannel

@:native("GetSpecular")getSpecular():Single

@:native("GetSpecularMode")getSpecularMode():SpatialMaterial_SpecularMode

@:native("GetSubsurfaceScatteringStrength")getSubsurfaceScatteringStrength():Single

@:native("GetTexture")getTexture(param:SpatialMaterial_TextureParam):Texture

Returns the godot.Texture associated with the specified godot.SpatialMaterial_TextureParam.

@:native("GetTransmission")getTransmission():Color

@:native("GetUv1Offset")getUv1Offset():Vector3

@:native("GetUv1Scale")getUv1Scale():Vector3

@:native("GetUv1TriplanarBlendSharpness")getUv1TriplanarBlendSharpness():Single

@:native("GetUv2Offset")getUv2Offset():Vector3

@:native("GetUv2Scale")getUv2Scale():Vector3

@:native("GetUv2TriplanarBlendSharpness")getUv2TriplanarBlendSharpness():Single

@:native("IsDepthDeepParallaxEnabled")isDepthDeepParallaxEnabled():Bool

@:native("IsGrowEnabled")isGrowEnabled():Bool

@:native("IsProximityFadeEnabled")isProximityFadeEnabled():Bool

@:native("SetAlbedo")setAlbedo(albedo:Color):Void

@:native("SetAlphaScissorThreshold")setAlphaScissorThreshold(threshold:Single):Void

@:native("SetAnisotropy")setAnisotropy(anisotropy:Single):Void

@:native("SetAoLightAffect")setAoLightAffect(amount:Single):Void

@:native("SetAoTextureChannel")setAoTextureChannel(channel:SpatialMaterial_TextureChannel):Void

@:native("SetBillboardMode")setBillboardMode(mode:SpatialMaterial_BillboardMode):Void

@:native("SetBlendMode")setBlendMode(blendMode:SpatialMaterial_BlendMode):Void

@:native("SetClearcoat")setClearcoat(clearcoat:Single):Void

@:native("SetClearcoatGloss")setClearcoatGloss(clearcoatGloss:Single):Void

@:native("SetCullMode")setCullMode(cullMode:SpatialMaterial_CullMode):Void

@:native("SetDepthDeepParallax")setDepthDeepParallax(enable:Bool):Void

@:native("SetDepthDeepParallaxFlipBinormal")setDepthDeepParallaxFlipBinormal(flip:Bool):Void

@:native("SetDepthDeepParallaxFlipTangent")setDepthDeepParallaxFlipTangent(flip:Bool):Void

@:native("SetDepthDeepParallaxMaxLayers")setDepthDeepParallaxMaxLayers(layer:Int):Void

@:native("SetDepthDeepParallaxMinLayers")setDepthDeepParallaxMinLayers(layer:Int):Void

@:native("SetDepthDrawMode")setDepthDrawMode(depthDrawMode:SpatialMaterial_DepthDrawMode):Void

@:native("SetDepthScale")setDepthScale(depthScale:Single):Void

@:native("SetDetailBlendMode")setDetailBlendMode(detailBlendMode:SpatialMaterial_BlendMode):Void

@:native("SetDetailUv")setDetailUv(detailUv:SpatialMaterial_DetailUV):Void

@:native("SetDiffuseMode")setDiffuseMode(diffuseMode:SpatialMaterial_DiffuseMode):Void

@:native("SetDistanceFade")setDistanceFade(mode:SpatialMaterial_DistanceFadeModeEnum):Void

@:native("SetDistanceFadeMaxDistance")setDistanceFadeMaxDistance(distance:Single):Void

@:native("SetDistanceFadeMinDistance")setDistanceFadeMinDistance(distance:Single):Void

@:native("SetEmission")setEmission(emission:Color):Void

@:native("SetEmissionEnergy")setEmissionEnergy(emissionEnergy:Single):Void

@:native("SetEmissionOperator")setEmissionOperator(operator_:SpatialMaterial_EmissionOperatorEnum):Void

@:native("SetFeature")setFeature(feature:SpatialMaterial_Feature, enable:Bool):Void

If true, enables the specified godot.SpatialMaterial_Feature. Many features that are available in godot.SpatialMaterials need to be enabled before use. This way the cost for using the feature is only incurred when specified. Features can also be enabled by setting the corresponding member to true.

@:native("SetFlag")setFlag(flag:SpatialMaterial_Flags, enable:Bool):Void

If true, enables the specified flag. Flags are optional behaviour that can be turned on and off. Only one flag can be enabled at a time with this function, the flag enumerators cannot be bit-masked together to enable or disable multiple flags at once. Flags can also be enabled by setting the corresponding member to true. See godot.SpatialMaterial_Flags enumerator for options.

@:native("SetGrow")setGrow(amount:Single):Void

@:native("SetGrowEnabled")setGrowEnabled(enable:Bool):Void

@:native("SetLineWidth")setLineWidth(lineWidth:Single):Void

@:native("SetMetallic")setMetallic(metallic:Single):Void

@:native("SetMetallicTextureChannel")setMetallicTextureChannel(channel:SpatialMaterial_TextureChannel):Void

@:native("SetNormalScale")setNormalScale(normalScale:Single):Void

@:native("SetParticlesAnimHFrames")setParticlesAnimHFrames(frames:Int):Void

@:native("SetParticlesAnimLoop")setParticlesAnimLoop(loop:Bool):Void

@:native("SetParticlesAnimVFrames")setParticlesAnimVFrames(frames:Int):Void

@:native("SetPointSize")setPointSize(pointSize:Single):Void

@:native("SetProximityFade")setProximityFade(enabled:Bool):Void

@:native("SetProximityFadeDistance")setProximityFadeDistance(distance:Single):Void

@:native("SetRefraction")setRefraction(refraction:Single):Void

@:native("SetRefractionTextureChannel")setRefractionTextureChannel(channel:SpatialMaterial_TextureChannel):Void

@:native("SetRim")setRim(rim:Single):Void

@:native("SetRimTint")setRimTint(rimTint:Single):Void

@:native("SetRoughness")setRoughness(roughness:Single):Void

@:native("SetRoughnessTextureChannel")setRoughnessTextureChannel(channel:SpatialMaterial_TextureChannel):Void

@:native("SetSpecular")setSpecular(specular:Single):Void

@:native("SetSpecularMode")setSpecularMode(specularMode:SpatialMaterial_SpecularMode):Void

@:native("SetSubsurfaceScatteringStrength")setSubsurfaceScatteringStrength(strength:Single):Void

@:native("SetTexture")setTexture(param:SpatialMaterial_TextureParam, texture:Texture):Void

Sets the godot.Texture to be used by the specified godot.SpatialMaterial_TextureParam. This function is called when setting members ending in *_texture.

@:native("SetTransmission")setTransmission(transmission:Color):Void

@:native("SetUv1Offset")setUv1Offset(offset:Vector3):Void

@:native("SetUv1Scale")setUv1Scale(scale:Vector3):Void

@:native("SetUv1TriplanarBlendSharpness")setUv1TriplanarBlendSharpness(sharpness:Single):Void

@:native("SetUv2Offset")setUv2Offset(offset:Vector3):Void

@:native("SetUv2Scale")setUv2Scale(scale:Vector3):Void

@:native("SetUv2TriplanarBlendSharpness")setUv2TriplanarBlendSharpness(sharpness:Single):Void

Inherited Variables

Defined by Material

@:native("NextPass")nextPass:Material

Sets the godot.Material to be used for the next pass. This renders the object again using a different material.

Note: This only applies to godot.SpatialMaterials and godot.ShaderMaterials with type "Spatial".

@:native("RenderPriority")renderPriority:Int

Sets the render priority for transparent objects in 3D scenes. Higher priority objects will be sorted in front of lower priority objects.

Note: This only applies to sorting of transparent objects. This will not impact how transparent objects are sorted relative to opaque objects. This is because opaque objects are not sorted, while transparent objects are sorted from back to front (subject to priority).

Defined by Resource

read onlyonChanged:Signal<() ‑> Void>

changed signal.

@:native("ResourceLocalToScene")resourceLocalToScene:Bool

If true, the resource will be made unique in each instance of its local scene. It can thus be modified in a scene instance without impacting other instances of that same scene.

@:native("ResourceName")resourceName:String

The name of the resource. This is an optional identifier. If godot.Resource.resourceName is not empty, its value will be displayed to represent the current resource in the editor inspector. For built-in scripts, the godot.Resource.resourceName will be displayed as the tab name in the script editor.

@:native("ResourcePath")resourcePath:String

The path to the resource. In case it has its own file, it will return its filepath. If it's tied to the scene, it will return the scene's path, followed by the resource's index.

Defined by Object

@:native("DynamicObject")read onlydynamicObject:Dynamic

Gets a new godot.DynamicGodotObject associated with this instance.

@:native("NativeInstance")read onlynativeInstance:IntPtr

The pointer to the native instance of this godot.Object.

read onlyonScriptChanged:Signal<() ‑> Void>

script_changed signal.

Inherited Methods

Defined by Material

@:native("GetNextPass")getNextPass():Material

@:native("GetRenderPriority")getRenderPriority():Int

@:native("SetNextPass")setNextPass(nextPass:Material):Void

@:native("SetRenderPriority")setRenderPriority(priority:Int):Void

Defined by Resource

@:native("_SetupLocalToScene")_SetupLocalToScene():Void

Virtual function which can be overridden to customize the behavior value of godot.Resource.setupLocalToScene.

@:native("Duplicate")duplicate(?subresources:Bool):Resource

Duplicates the resource, returning a new resource with the exported members copied. Note: To duplicate the resource the constructor is called without arguments. This method will error when the constructor doesn't have default values.

By default, sub-resources are shared between resource copies for efficiency. This can be changed by passing true to the subresources argument which will copy the subresources.

Note: If subresources is true, this method will only perform a shallow copy. Nested resources within subresources will not be duplicated and will still be shared.

Note: When duplicating a resource, only exported properties are copied. Other properties will be set to their default value in the new resource.

@:native("EmitChanged")emitChanged():Void

Emits the changed signal.

If external objects which depend on this resource should be updated, this method must be called manually whenever the state of this resource has changed (such as modification of properties).

The method is equivalent to:


emit_signal("changed")

Note: This method is called automatically for built-in resources.

@:native("GetLocalScene")getLocalScene():Node

If godot.Resource.resourceLocalToScene is enabled and the resource was loaded from a godot.PackedScene instantiation, returns the local scene where this resource's unique copy is in use. Otherwise, returns null.

@:native("GetName")getName():String

@:native("GetPath")getPath():String

@:native("GetRid")getRid():RID

Returns the RID of the resource (or an empty RID). Many resources (such as godot.Texture, godot.Mesh, etc) are high-level abstractions of resources stored in a server, so this function will return the original RID.

@:native("IsLocalToScene")isLocalToScene():Bool

@:native("SetLocalToScene")setLocalToScene(enable:Bool):Void

@:native("SetName")setName(name:String):Void

@:native("SetPath")setPath(path:String):Void

@:native("SetupLocalToScene")setupLocalToScene():Void

This method is called when a resource with godot.Resource.resourceLocalToScene enabled is loaded from a godot.PackedScene instantiation. Its behavior can be customized by overriding godot.Resource._SetupLocalToScene from script.

For most resources, this method performs no base logic. godot.ViewportTexture performs custom logic to properly set the proxy texture and flags in the local viewport.

@:native("TakeOverPath")takeOverPath(path:String):Void

Sets the path of the resource, potentially overriding an existing cache entry for this path. This differs from setting godot.Resource.resourcePath, as the latter would error out if another resource was already cached for the given path.

Defined by Reference

@:native("InitRef")initRef():Bool

Initializes the internal reference counter. Use this only if you really know what you are doing.

Returns whether the initialization was successful.

@:native("Reference_")reference_():Bool

Increments the internal reference counter. Use this only if you really know what you are doing.

Returns true if the increment was successful, false otherwise.

@:native("Unreference")unreference():Bool

Decrements the internal reference counter. Use this only if you really know what you are doing.

Returns true if the decrement was successful, false otherwise.

Defined by Object

@:native("_Get")_Get(property:String):Dynamic

Virtual method which can be overridden to customize the return value of godot.Object.get.

Returns the given property. Returns null if the property does not exist.

@:native("_GetPropertyList")_GetPropertyList():Array

Virtual method which can be overridden to customize the return value of godot.Object.getPropertyList.

Returns the object's property list as an godot.Collections_Array of dictionaries.

Each property's godot.Collections_Dictionary must contain at least name: String and type: int (see godot.Variant_Type) entries. Optionally, it can also include hint: int (see godot.PropertyHint), hint_string: String, and usage: int (see godot.PropertyUsageFlags).

@:native("_Notification")_Notification(what:Int):Void

Called whenever the object receives a notification, which is identified in what by a constant. The base godot.Object has two constants godot.Object.notificationPostinitialize and godot.Object.notificationPredelete, but subclasses such as godot.Node define a lot more notifications which are also received by this method.

@:native("_Set")_Set(property:String, value:Dynamic):Bool

Virtual method which can be overridden to customize the return value of godot.Object.set.

Sets a property. Returns true if the property exists.

@:native("AddUserSignal")addUserSignal(signal:String, ?arguments:Array):Void

Adds a user-defined signal. Arguments are optional, but can be added as an godot.Collections_Array of dictionaries, each containing name: String and type: int (see godot.Variant_Type) entries.

Parameters:

arguments

If the parameter is null, then the default value is new Godot.Collections.Array { }

@:native("Call")call(method:String, args:HaxeArray<Dynamic>):Dynamic

Calls the method on the object and returns the result. This method supports a variable number of arguments, so parameters are passed as a comma separated list. Example:


call("set", "position", Vector2(42.0, 0.0))

Note: In C#, the method name must be specified as snake_case if it is defined by a built-in Godot node. This doesn't apply to user-defined methods where you should use the same convention as in the C# source (typically PascalCase).

@:native("CallDeferred")callDeferred(method:String, args:HaxeArray<Dynamic>):Void

Calls the method on the object during idle time. This method supports a variable number of arguments, so parameters are passed as a comma separated list. Example:


call_deferred("set", "position", Vector2(42.0, 0.0))

Note: In C#, the method name must be specified as snake_case if it is defined by a built-in Godot node. This doesn't apply to user-defined methods where you should use the same convention as in the C# source (typically PascalCase).

@:native("Callv")callv(method:String, argArray:Array):Dynamic

Calls the method on the object and returns the result. Contrarily to godot.Object.call, this method does not support a variable number of arguments but expects all parameters to be via a single godot.Collections_Array.


callv("set", [ "position", Vector2(42.0, 0.0) ])

@:native("CanTranslateMessages")canTranslateMessages():Bool

Returns true if the object can translate strings. See godot.Object.setMessageTranslation and godot.Object.tr.

@:native("Connect")connect(signal:String, target:Object, method:String, ?binds:Array, ?flags:UInt):Error

Connects a signal to a method on a target object. Pass optional binds to the call as an godot.Collections_Array of parameters. These parameters will be passed to the method after any parameter used in the call to godot.Object.emitSignal. Use flags to set deferred or one-shot connections. See godot.Object_ConnectFlags constants.

A signal can only be connected once to a method. It will print an error if already connected, unless the signal was connected with godot.Object_ConnectFlags.referenceCounted. To avoid this, first, use godot.Object.isConnected to check for existing connections.

If the target is destroyed in the game's lifecycle, the connection will be lost.

Examples:


connect("pressed", self, "_on_Button_pressed") # BaseButton signal
connect("text_entered", self, "_on_LineEdit_text_entered") # LineEdit signal
connect("hit", self, "_on_Player_hit", [ weapon_type, damage ]) # User-defined signal

An example of the relationship between binds passed to godot.Object.connect and parameters used when calling godot.Object.emitSignal:


connect("hit", self, "_on_Player_hit", [ weapon_type, damage ]) # weapon_type and damage are passed last
emit_signal("hit", "Dark lord", 5) # "Dark lord" and 5 are passed first
func _on_Player_hit(hit_by, level, weapon_type, damage):
print("Hit by %s (lvl %d) with weapon %s for %d damage" % [hit_by, level, weapon_type, damage])

Parameters:

binds

If the parameter is null, then the default value is new Godot.Collections.Array { }

@:native("Disconnect")disconnect(signal:String, target:Object, method:String):Void

Disconnects a signal from a method on the given target.

If you try to disconnect a connection that does not exist, the method will print an error. Use godot.Object.isConnected to ensure that the connection exists.

@:native("Dispose")dispose():Void

@:native("Dispose")@:protectedDispose(disposing:Bool):Void

Disposes of this godot.Object.

@:native("EmitSignal")emitSignal(signal:String, args:HaxeArray<Dynamic>):Void

Emits the given signal. The signal must exist, so it should be a built-in signal of this class or one of its parent classes, or a user-defined signal. This method supports a variable number of arguments, so parameters are passed as a comma separated list. Example:


emit_signal("hit", weapon_type, damage)
emit_signal("game_over")

@:native("Free")free():Void

Deletes the object from memory immediately. For godot.Nodes, you may want to use godot.Node.queueFree to queue the node for safe deletion at the end of the current frame.

Important: If you have a variable pointing to an object, it will not be assigned to null once the object is freed. Instead, it will point to a previously freed instance and you should validate it with @GDScript.is_instance_valid before attempting to call its methods or access its properties.

@:native("Get")get(property:String):Dynamic

Returns the Variant value of the given property. If the property doesn't exist, this will return null.

Note: In C#, the property name must be specified as snake_case if it is defined by a built-in Godot node. This doesn't apply to user-defined properties where you should use the same convention as in the C# source (typically PascalCase).

@:native("GetClass")getClass():String

Returns the object's class as a String. See also godot.Object.isClass.

Note: godot.Object.getClass does not take class_name declarations into account. If the object has a class_name defined, the base class name will be returned instead.

@:native("GetIncomingConnections")getIncomingConnections():Array

Returns an godot.Collections_Array of dictionaries with information about signals that are connected to the object.

Each godot.Collections_Dictionary contains three String entries:

  • source is a reference to the signal emitter.

  • signal_name is the name of the connected signal.

  • method_name is the name of the method to which the signal is connected.

@:native("GetIndexed")getIndexed(property:NodePath):Dynamic

Gets the object's property indexed by the given godot.NodePath. The node path should be relative to the current object and can use the colon character (:) to access nested properties. Examples: "position:x" or "material:next_pass:blend_mode".

Note: Even though the method takes godot.NodePath argument, it doesn't support actual paths to godot.Nodes in the scene tree, only colon-separated sub-property paths. For the purpose of nodes, use godot.Node.getNodeAndResource instead.

@:native("GetInstanceId")getInstanceId():UInt64

Returns the object's unique instance ID.

This ID can be saved in godot.EncodedObjectAsID, and can be used to retrieve the object instance with @GDScript.instance_from_id.

@:native("GetMeta")getMeta(name:String):Dynamic

Returns the object's metadata entry for the given name.

inlinegetMetaList():Array<String>

Returns the object's metadata as a String.

@:native("GetMethodList")getMethodList():Array

Returns the object's methods and their signatures as an godot.Collections_Array.

@:native("GetPropertyList")getPropertyList():Array

Returns the object's property list as an godot.Collections_Array of dictionaries.

Each property's godot.Collections_Dictionary contain at least name: String and type: int (see godot.Variant_Type) entries. Optionally, it can also include hint: int (see godot.PropertyHint), hint_string: String, and usage: int (see godot.PropertyUsageFlags).

@:native("GetScript")getScript():Reference

Returns the object's godot.Script instance, or null if none is assigned.

@:native("GetSignalConnectionList")getSignalConnectionList(signal:String):Array

Returns an godot.Collections_Array of connections for the given signal.

@:native("GetSignalList")getSignalList():Array

Returns the list of signals as an godot.Collections_Array of dictionaries.

@:native("HasMeta")hasMeta(name:String):Bool

Returns true if a metadata entry is found with the given name.

@:native("HasMethod")hasMethod(method:String):Bool

Returns true if the object contains the given method.

@:native("HasSignal")hasSignal(signal:String):Bool

Returns true if the given signal exists.

@:native("HasUserSignal")hasUserSignal(signal:String):Bool

Returns true if the given user-defined signal exists. Only signals added using godot.Object.addUserSignal are taken into account.

@:native("IsBlockingSignals")isBlockingSignals():Bool

Returns true if signal emission blocking is enabled.

@:native("IsClass")isClass(class_:String):Bool

Returns true if the object inherits from the given class. See also godot.Object.getClass.

Note: godot.Object.isClass does not take class_name declarations into account. If the object has a class_name defined, godot.Object.isClass will return false for that name.

@:native("IsConnected")isConnected(signal:String, target:Object, method:String):Bool

Returns true if a connection exists for a given signal, target, and method.

@:native("IsQueuedForDeletion")isQueuedForDeletion():Bool

Returns true if the godot.Node.queueFree method was called for the object.

@:native("Notification")notification(what:Int, ?reversed:Bool):Void

Send a given notification to the object, which will also trigger a call to the godot.Object._Notification method of all classes that the object inherits from.

If reversed is true, godot.Object._Notification is called first on the object's own class, and then up to its successive parent classes. If reversed is false, godot.Object._Notification is called first on the highest ancestor (godot.Object itself), and then down to its successive inheriting classes.

@:native("PropertyListChangedNotify")propertyListChangedNotify():Void

Notify the editor that the property list has changed, so that editor plugins can take the new values into account. Does nothing on export builds.

@:native("RemoveMeta")removeMeta(name:String):Void

Removes a given entry from the object's metadata. See also godot.Object.setMeta.

@:native("Set")set(property:String, value:Dynamic):Void

Assigns a new value to the given property. If the property does not exist or the given value's type doesn't match, nothing will happen.

Note: In C#, the property name must be specified as snake_case if it is defined by a built-in Godot node. This doesn't apply to user-defined properties where you should use the same convention as in the C# source (typically PascalCase).

@:native("SetBlockSignals")setBlockSignals(enable:Bool):Void

If set to true, signal emission is blocked.

@:native("SetDeferred")setDeferred(property:String, value:Dynamic):Void

Assigns a new value to the given property, after the current frame's physics step. This is equivalent to calling godot.Object.set via godot.Object.callDeferred, i.e. call_deferred("set", property, value).

Note: In C#, the property name must be specified as snake_case if it is defined by a built-in Godot node. This doesn't apply to user-defined properties where you should use the same convention as in the C# source (typically PascalCase).

@:native("SetIndexed")setIndexed(property:NodePath, value:Dynamic):Void

Assigns a new value to the property identified by the godot.NodePath. The node path should be relative to the current object and can use the colon character (:) to access nested properties. Example:


set_indexed("position", Vector2(42, 0))
set_indexed("position:y", -10)
print(position) # (42, -10)

@:native("SetMessageTranslation")setMessageTranslation(enable:Bool):Void

Defines whether the object can translate strings (with calls to godot.Object.tr). Enabled by default.

@:native("SetMeta")setMeta(name:String, value:Dynamic):Void

Adds, changes or removes a given entry in the object's metadata. Metadata are serialized and can take any Variant value.

To remove a given entry from the object's metadata, use godot.Object.removeMeta. Metadata is also removed if its value is set to null. This means you can also use set_meta("name", null) to remove metadata for "name".

@:native("SetScript")setScript(script:Reference):Void

Assigns a script to the object. Each object can have a single script assigned to it, which are used to extend its functionality.

If the object already had a script, the previous script instance will be freed and its variables and state will be lost. The new script's method will be called.

@:native("ToSignal")toSignal(source:Object, signal:String):SignalAwaiter

Returns a new godot.SignalAwaiter awaiter configured to complete when the instance source emits the signal specified by the signal parameter.

Parameters:

source

The instance the awaiter will be listening to.

signal

The signal the awaiter will be waiting for. This sample prints a message once every frame up to 100 times.

public override void _Ready()
{
for (int i = 0; i &lt; 100; i++)
{
await ToSignal(GetTree(), "idle_frame");
GD.Print($"Frame {i}");
}
}

Returns:

A godot.SignalAwaiter that completes when source emits the signal.

@:native("ToString")toString():String

Converts this godot.Object to a string.

Returns:

A string representation of this object.

@:native("Tr")tr(message:String):String

Translates a message using translation catalogs configured in the Project Settings.

Only works if message translation is enabled (which it is by default), otherwise it returns the message unchanged. See godot.Object.setMessageTranslation.