Before i dont write code in LUA so i find out one thing strange in this code:
function update(self, dt)
local from = go.get_position()
local to = self.to
local result = physics.raycast(from, to, { hash("stone") }) -- <4>
if result then
draw_line(from, result.position) -- <5>
else
draw_line(from, to) -- <6>
end
end
physics.raycast return a table, not a bolean variable. So why this condition work?
if result then.
result contains a table not a bolean variable, i wanna know it’s a specific of DEFOLD or it’s normal behaviour for LUA?