boruok
1
Originally whanted to change change particle color, docs says:
function init(self)
particlefx.set_constant("#particlefx", "emitter", "tint", vmath.vector4(1, 0, 0, 1))
end
This how template looks:
If i try, to change color:
particlefx.set_constant("idle", "emitter", "tint", vmath.vector4(1, 0, 0, 1))
or
particlefx.set_constant("#idle", "emitter", "tint", vmath.vector4(1, 0, 0, 1))
or
particlefx.set_constant("#cauldron/idle", "emitter", "tint", vmath.vector4(1, 0, 0, 1))
or
particlefx.set_constant("cauldron_idle", "emitter", "tint", vmath.vector4(1, 0, 0, 1))
so on...
It thows error:
Component '/go#cauldron/idle' could not be found when dispatching message 'set_constant_particle_fx' sent from play:/go#play
Asatte
2
On the gui you’ve used your templte, find the particlefx you want to access and copy the url it has. This should fix the problem I believe
boruok
3
nope, even if particle not within template.
function init(self)
gui.play_particlefx(gui.get_node("particlefx"))
local url = msg.url(nil, nil, "main")
particlefx.set_constant(url, "emitter", "tint", vmath.vector4(0, 1, 0, 1))
end
however overriding works in game objects:
function init(self)
particlefx.play("#main")
particlefx.set_constant("#main", "emitter", "tint", vmath.vector4(1, 0, 0, 1))
end
Can someone look:
Empty Project.zip (73.1 KB)
boruok
4
found some example, but there they added an assigned particle material to ! particle node and override material tint. Not quite what needed.