Log In  


Hello,
Reading the user manual, I see there are states for actors (in 10.3.1: Common Actor Events).
Is it possible to access those states in lua, like a bool or a function?
Thank You



1

Not currently (this is planned for 0.3.6).

A slightly messy work-around in the meantime is to create a modifier (under the New Item menu), use the desired state as the trigger, and with a length (duration) of 1. So the modifier will be active only when that state is true, frame by frame.

You can then check the state of that modifier from inside a script:

function draw()
	if this:is_active("is_standing") then
		local x,y,z = this:get_xyz()
		sphere(x,y,z-20,4,14)
	end
end

That did it, thank you!


Fun little bit :)



[Please log in to post a comment]