Notifications
Clear all

[Closed] Script Controller stops response during animation

Hi!
I am setting up an automated animation system, where a PFlow object launches projectiles at a target when the target arrives within a certain distance.

I have an odd issue though. I am using a Float Script controller on the PFlow’s rate value, with a script as such:

dependsOn $cannon $target $cannonCPU
if (distance $cannon $target) > $cannonCPU.modifiers[#Attribute_Holder].Custom_Attributes.distance
then
(0;)
else
(2;)

So when the target is out of the distance, the pflow will not fire, and vice versa. However in pratice, the script oddly stops working around the 200 frame mark (animation length is set from -10 to 350, and I’ve set the pFlow to be active between -10 to 400… I’ve attached the trackview of the rate and .max file. Thanks for any advice!!!

GW

3 Replies

have you checked the ranges on the script controller ?

mark

Ok my fault. I have found the problem! Evidently I didn’t adjust the keys in the dope sheet. Argh!

But there seems to be another problem – the cannon fires off a single round at the very start of the animation. Do you guys know why?

I’ve included the updated max file with this post.

TIA!

GW

marktsang, thanks mate! Happened to post reply with ya at the same time

GW