Start animation on frame
-
I have created a scene with multiple SP animations. I need two objects to begin moving at the start of the animation. I would like the third object to begin at a specified frame #. If I set everything to run from the beginning, the file works fine. If I change Object 3 to start on a delay (I have tried using "if frame>200" and also tried "if frame==200"), Objects 1 and 2 start to move, but after Object 3 starts, the file crashes. I'm using ontick for all 3 objects. Is there a different set of commands I should be using?
-
Any help from SP users? Is delaying part of simulation possible?
-
It is possible yes, you probably just have some errors in the code/model.
Best if you attach your model, or paste the code so we can have a look at it.
-
That model is on my computer at work, but I'll stop by there later and post part of it. The code I have is all probably your stuff anyway, ha! Thanks.
-
Mr. K, here is the model with some more detail on what I'd like to do and what I've tried.
-
Think I got what you needed.
I was going to explain the script line by line but this forum is exceptionally horrible for posting code, so if there is anything specifically you won't understand just ask me later.
-
This works perfectly, and even the curves stayed oriented the right way. Compensating for stopping distance was brilliant. This was more complicated than the one line of code I was trying to change. Thanks so much!
The one thing I don't understand is the second line below:
dir=position.vector_to(evalCurveAbs("camera3", @new_distance1))
dir.length/=5
setVelocity(dir.to_a)The first line sets the direction of the object to follow the path named camera3 for a set distance. The third line sets the speed. What does "dir.length/=5" do?
-
dir.length/=5 simply divides the pulling vector length/strength by 5, that way the pull is more gentle and the starts are smoother( a more car like movement), greater the number gentler the pull.
But going too far with speed and smoothing can cause rubber banding.
Advertisement