Read an object's built-in values via events

Hi,

I don’t know how to read an object’s values in the event sheet and would be very grateful for any help.

In this case, I have a light with a certain radius and I want to read that radius. The event sheet has an entry for setting it, but I can’t find an expression for reading it.

The best I can think of is Light.Variable(Radius), but that return’s 0.

In general, I’d like to know how to access any built-in value. I know you can use .X(), etc, but what about other values?

Any help appreciated.

Neil

You need a text object. Then use the event change text and set text of text object to
Light.VariableString(Radius)
Numbers need to be converted to text first before being displayed as text.
For variables that mean you put the word String after it to convert it.
Variable(alpha) = VariableString(alpha).
Alternatively and in some number cases that aren’t variables like VariableChildCount you can use ToString(Light.Variable(Radius))

Think of the radius of an object in nothing more than its size divided by 2, in other words just use:

Light.Width() / 2

Thanks, but it doesn’t work I’m afraid. It works for variables I create myself, but when I set Light’s Radius to 450 in the object properties panel, then set the text to it with Light.VariableString(Radius) or (radius) it reads zero.

My goal wasn’t to just print the value though, I wanted to decrease it every frame with something like
Set Radius of Light to Light.Radius() -1, for example.
I’ve used a scene var instead, reducing that then setting the light’s radius to it, but I was hoping for a better way, and a way to find values (not ones I created myself) in general.

Thanks again for your reply.

this is the way to handle it. i would use object variables, instead of scene variables tho, in case you want to manipulate lights separately.

keep in mind that lights are still a fairly new feature, and direct access to its values might be implemented if requested.

Thanks for you help, appreciated.