SIsilicon / Godot-God-Rays-Plugin

MIT License
145 stars 10 forks source link

Invalid get index 'omni_range' (on base: 'Nil'). #3

Open WilliamTambellini opened 2 years ago

WilliamTambellini commented 2 years ago

To prevent an exception/error if the parent light is a spotlight: https://github.com/SIsilicon/Godot-God-Rays-Plugin/blob/7a04b002472a05e1e179349328f51c1bb566aea6/addons/SIsilicon.vfx.godrays/GodRays.gd#L62 Switch:

material.set_shader_param("size", light_size * (light as OmniLight).omni_range)

to

if light is OmniLight:
    material.set_shader_param("size", light_size * (light as OmniLight).omni_range)

or similar similar (warning, ...)