Hi, this forum is brilliant 🙂
I now have a “Dummy” object and I want to rotate on “X” axis.
As it rotates, I want it to turn a light on and off at predefined angels.
I put a Float Script on X axis of my “Dummy” object and wrote this:
dummyRotation = $.rotation.x
if dummyRotation >= 10.0 and dummyRotation < 12.0 then
(
Spark001.Multiplier = 1.0 -- Turn on Spark001
)
else
(
Spark001.Multiplier = 0.0 -- Turn off Spark001
)
But when I Evaluate, I get –Unknown property: “multiplier” in undefined? Do I need a Variable?
Regards
Rog 😊
I'm not familiar with spark lights but this is something that you should easily be able to do with a Wire Parameter.
For example, when the teapot angle in the following is >= 10° and < 12° the intensity is 1500, if not it's 0.
I think, the error message is clear: "Unknown property: “multiplier” in undefined"
You have to find answers for these questions:
Is "Spark001" a variable you already defined somewhere else or is it undefined?
Is "Multiplier " a property of the object ?
Hi Leeminardi 🙂 This seamed to work as a test. I now need to try it on my main model 🙂
Thank you, kind regards
Rog
@Roger.Bastow I should have noted that if it is possible that the object will rotate more than one full revolution then the modulo function "mod" should be used to always get an angle between 0 and 360. Although the Transform Type-in may show an angle less than 360 it could be the remainder of the angle dividied by 360.
The wire expresson should be something like:
if(((mod (radToDeg(X_Rotation)) 360) >= 10) and ((mod (radToDeg(X_rotation)) 360) < 12)) then 1500 else 0
Can't find what you're looking for? Ask the community or share your knowledge.