<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Maratis forum - isAnimationOver?(help)]]></title>
		<link>http://forum.maratis3d.com/viewtopic.php?id=854</link>
		<description><![CDATA[The most recent posts in isAnimationOver?(help).]]></description>
		<lastBuildDate>Fri, 25 Oct 2013 05:36:44 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: isAnimationOver?(help)]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=5806#p5806</link>
			<description><![CDATA[<p>Maybe the functions are not in the right place. Just to be sure:</p><p>- all the code above must be put outside of onSceneUpdate()<br />- inside onSceneUpdate() call the Animate(obj) function</p>]]></description>
			<author><![CDATA[dummy@example.com (com3D)]]></author>
			<pubDate>Fri, 25 Oct 2013 05:36:44 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=5806#p5806</guid>
		</item>
		<item>
			<title><![CDATA[Re: isAnimationOver?(help)]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=5796#p5796</link>
			<description><![CDATA[<p>ugh! I was sure that would work, but now it doesn&#039;t both animations again, just loops one. I will go to another project for now, maybe it will come to me. Thanks com3D.</p>]]></description>
			<author><![CDATA[dummy@example.com (Tutorial Doctor)]]></author>
			<pubDate>Fri, 25 Oct 2013 00:14:11 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=5796#p5796</guid>
		</item>
		<item>
			<title><![CDATA[Re: isAnimationOver?(help)]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=5768#p5768</link>
			<description><![CDATA[<p>This should do the trick :</p><div class="codebox"><pre><code>walk_animation = 0
transition_animation = 1
idle_animation = 2
speed = .3
btn = &quot;W&quot;

function Walk(obj)
    changeAnimation(obj,walk_animation)
end

function Transition(obj)
    changeAnimation(obj,transition_animation)
    if isAnimationOver(obj) then
        transitioning = false
    end
end

function BeIdle(obj)
    changeAnimation(obj,idle_animation)
end

function Animate(obj)
    if isKeyPressed(btn) then
        Walk(obj)
        setAnimationSpeed(obj,speed)
        walking =true
        transitioning = true -- get ready for transition
    end
    
    if onKeyUp(btn) then
        if transitioning then Transition(obj)
        else BeIdle(obj) end
    end
end</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (com3D)]]></author>
			<pubDate>Thu, 24 Oct 2013 06:10:21 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=5768#p5768</guid>
		</item>
		<item>
			<title><![CDATA[Re: isAnimationOver?(help)]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=5761#p5761</link>
			<description><![CDATA[<p>Looking at the Animate function I got the animations to play in sequence but now when I press the key I get a freeze frame of the idle animation:</p><div class="codebox"><pre><code>walk_animation = 0
transition_animation = 1
idle_animation = 2
speed = .3
btn = &quot;W&quot;

function Walk(obj)
    changeAnimation(obj,walk_animation)
end

function Transition(obj)
    changeAnimation(obj,transition_animation)
end

function BeIdle(obj)
    changeAnimation(obj,idle_animation)
end

function Animate(obj)
    if isKeyPressed(btn) then
        Walk(obj)
        setAnimationSpeed(obj,speed)
        walking =true
    end
    
    if onKeyUp(btn) then
        Transition(obj)
        transitioning=true
    end
    
    if isAnimationOver(obj) then
        transitioning = false
    
    elseif not transitioning then
        BeIdle(obj)
    end
end</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (Tutorial Doctor)]]></author>
			<pubDate>Wed, 23 Oct 2013 21:43:07 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=5761#p5761</guid>
		</item>
		<item>
			<title><![CDATA[Re: isAnimationOver?(help)]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=5760#p5760</link>
			<description><![CDATA[<p>Here is another iteration I have to test:</p><div class="codebox"><pre><code>walk_animation = 0
transition_animation = 1
idle_animation = 2
speed = .3
btn = &quot;W&quot;


function Walk()
    changeAnimation(obj,walk_animation)
end

function Transition()
    changeAnimation(obj,transition_animation)
end

function BeIdle()
    changeAnimation(obj,idle_animation)
end

function Animate(obj)
    if isKeyPressed(btn) then
        Walk()
        setAnimationSpeed(obj,speed)
        walking =true
    
    elseif onKeyUp(btn) then
        Transition()
        transitioning=true
    end
    
    if isAnimationOver(obj) then
        transitioning = false
    end
    
    if not transitioning then
        BeIdle()
    end
end

function onSceneUpdate()
    Animate(person)
end</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (Tutorial Doctor)]]></author>
			<pubDate>Wed, 23 Oct 2013 21:25:19 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=5760#p5760</guid>
		</item>
		<item>
			<title><![CDATA[Re: isAnimationOver?(help)]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=5759#p5759</link>
			<description><![CDATA[<p>I wasn&#039;t able to get it to work, so I reformatted my code:</p><div class="codebox"><pre><code>person = getObject(&quot;Person&quot;)

walk_animation = 0
transition_animation = 1
idle_animation = 2

function Walk()
    changeAnimation(obj,walk_animation)
end

function Transition()
    changeAnimation(obj,transition_animation)
end

function BeIdle()
    changeAnimation(obj,idle_animation)
end

function Animate(obj)
    if isKeyPressed(anim_btn) then
        Walk()
        setAnimationSpeed(obj,anim_speed)
    end
    
    if onKeyUp(anim_btn) then
        Transition()
        BeIdle()
    end
end

function onSceneUpdate()
    Animate(person)
end</code></pre></div><p>So the conditions I want is that if a key is pressed I want to play the walk animation. If the key is released I want the character to play a transition animation and then an idle animation, and keep doing the idle animation until the key is pressed again.</p><p>How would I set the conditionals up in the Animate() function exactly?&nbsp; I know I have to use isKeyPressed().</p>]]></description>
			<author><![CDATA[dummy@example.com (Tutorial Doctor)]]></author>
			<pubDate>Wed, 23 Oct 2013 21:01:05 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=5759#p5759</guid>
		</item>
		<item>
			<title><![CDATA[Re: isAnimationOver?(help)]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=5757#p5757</link>
			<description><![CDATA[<p>Currently your animation 2 is only played 1 frame (just after animation 1 is over), then on the next scene update you loop back to animation 1 because onKeyUp condition is satisfied.</p><p>You could do something like :</p><div class="codebox"><pre><code>if isAnimationOver(anim_object) then anim3=true end</code></pre></div><p>and add:<br /></p><div class="codebox"><pre><code>elseif anim3 then
        changeAnimation(anim_object,2)
        setAnimationSpeed(anim_object,.3)
end</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (com3D)]]></author>
			<pubDate>Wed, 23 Oct 2013 19:58:12 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=5757#p5757</guid>
		</item>
		<item>
			<title><![CDATA[isAnimationOver?(help)]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=5752#p5752</link>
			<description><![CDATA[<p>I can&#039;t seem to understand how isAnimationOver() works. How do I get animations to play in succession? Here is the code:</p><div class="codebox"><pre><code>function Animate(anim_object,anim_walk,anim_btn,anim_speed)--,anim_sound)
    if isKeyPressed(anim_btn) then
        idle = false
        walking = true
        changeAnimation(anim_object,anim_walk)
        setAnimationSpeed(anim_object,anim_speed)
        --playSound(anim_sound)
        
    
    elseif onKeyUp(anim_btn) then
        idle = true
        walking = false
        changeAnimation(anim_object,1)
        
        if isAnimationOver(anim_object) then
            changeAnimation(anim_object,2)
            setAnimationSpeed(anim_object,.3)
        end
        --stopSound(anim_sound)
    end
end</code></pre></div><p>I want the character to play a certain animation when a key is released. And then, after it plays that animation, I want it to play another animation (I would think this animation continues to play).</p><p>However, in this code, the first animation plays and the next animation never plays, it just keeps playing the first animaton (animation 1).</p>]]></description>
			<author><![CDATA[dummy@example.com (Tutorial Doctor)]]></author>
			<pubDate>Wed, 23 Oct 2013 19:10:47 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=5752#p5752</guid>
		</item>
	</channel>
</rss>
