This is how the script in the ball looks it is linked in flowchart editor to out of CollisionTrigger.lua script.
Script.score = "0"
Script.hit_test1 = false
Script.hit_test2 = false
function Script:Ball_hit1()--in
self.hit_test1 = true
if self.hit_test1 == true then
self.score = "50"
end
end
--[[function Script:Ball_hit2()--in
self.hit_test2 = true
end
]]--
function Script:PostRender(context)
context:SetBlendMode(Blend.Alpha)
if self.hit_test1 == true or self.hit_test2 == true then
local context=Context:GetCurrent()
context:SetBlendMode(Blend.Alpha) --Set blend to alpha so only letters will show
context:DrawText("Score: ".. self.score .."",5,150) --Set text and position of text
else
local context=Context:GetCurrent()
context:SetBlendMode(Blend.Alpha) --Set blend to alpha so only letters will show
context:DrawText("Score: ".. self.score .."",5,150) --Set text and position of text
end
end
If I put in Player in the CollisionTrigger.lua script instead of ball it works fine.
Also try Name instead of name in CollisionTrigger.lua script but then script did not work any more when I tested it with Player.