I’m trying to project an image onto the top surface of an EditableMesh (the EM is just a cube)
local EditableImage = AssetService:CreateEditableImage({Size = Vector2.new(512,512)})
local BrushImage = AssetService:CreateEditableImageAsync(Content.fromUri("rbxassetid://130930689780864"), {Size = Vector2.new(512,512)})
local projectionParams: ProjectionParams = {
Direction = Vector3.new(0, 1, 0),
Position = Vector3.new(0, 0, 0),
Size = Vector3.new(1, 1, 1),
Up = PreviewMesh.CFrame:VectorToObjectSpace(Vector3.new(0, 1, 0)),
}
local localBrushConfig: BrushConfig = {
Decal = BrushImage,
ColorBlendType = Enum.ImageCombineType.BlendSourceOver,
AlphaBlendType = Enum.ImageAlphaType.Default,
BlendIntensity = 1,
FadeAngle = 90.0
}
EditableImage:DrawImageProjected(PreviewMesh, projectionParams, localBrushConfig) -- error
This is the error I get
Missing or null attribute in drawImageProjected!
Worth noting, that the example provided in the announcement gives the same error
local AssetService = game:GetService("AssetService")
local editableImage = AssetService:CreateEditableImage({Size = Vector2.new(512,512),})
local brushImage = AssetService:CreateEditableImage({Size = Vector2.new(512,512),})
local relativePos = meshPart.CFrame:PointToWorldSpace(raycastHitPos)
local direction = (game.Workspace.CurrentCamera.CFrame.Position - relativePos).Unit
local projectionParams: ProjectionParams = {
Direction = meshPart.CFrame:VectorToObjectSpace(direction),
Position = meshPart.CFrame:PointToObjectSpace(relativePos),
Size = Vector3.new(1, 1, 1),
Up = meshPart.CFrame:VectorToObjectSpace(Vector3.new(0, 1, 0)),
}
local localBrushConfig: BrushConfig = {
Decal = brushImage,
ColorBlendType = Enum.ImageCombineType.BlendSourceOver,
AlphaBlendType = Enum.ImageAlphaType.Default,
BlendIntensity = 1,
FadeAngle = 90.0
}
editableImage:DrawImageProjected(meshPart, projectionParams, localBrushConfig)
Expected behavior
What the announcement post seemed to show off