Hi, I’m essentially trying to make a sprite invisible (that code works fine), or even just disable it (idk if that’s possible) when the user clicks a button on a character selection screen. The sprite is within the first level collection which uses a tilemap.
This code is on the sending half:
msg.post("main:/controller", "load level 1")
function on_message(self, message_id, message)
if message_id == hash("proxy_loaded") then
if character == "male" then
msg.post("girlpl:/controller", hash("set female invisible"))
elseif character == "female" then
msg.post("boypl:/controller", hash("set male invisible"))
end
if maledisable == true then
msg.post("girlpl:/controller", hash("reset female to visible"))
elseif femaledisable == true then
msg.post("boypl:/controller", hash("reset male to visible"))
end
end
end
And this is an example of the receiving half for one of sprite scripts (they use the same code and both don’t work)
function on_message(self, message_id, message, sender)
if message_id == hash("set male invisible") then
go.set("#boyplayer", "tint", vmath.vector4(0, 0, 0, 0))
elseif message_id == hash("reset male to visible") then
go.set("#boylayer", "tint", vmath.vector4(1, 1, 1, 1))
end
end
Any advice is sincerely appreciated