Hey guys, I’ve been working on a game and I have a plane that has an animation map of an explosion on it, it plays perfectly but it keeps on repeating the animation.
Is there any way to control when the animation starts, like when I hit a certain keyboard key, and can I turn something off to stop the texture from repeating.
That would work for the first explosion, but when another explosion is set off the animation texture will not restart to the first frame. I guess what I am trying to say is how can I have the animation texture restart on the plane every time it enters the scene through the edit object option in the game logic editor.
You can animate the plane to scale down to zero once the first explosion is done and scale back up right before the second explosion starts. That should do the trick.
I’m trying to do this with out Python scripting, is there any way to do this without using scripts. I’m probably not saying it right but here is another shot at explaining my problem, when you hit P to play the game in blender the texture keeps on looping over and over even if it is not in the main layer of the game, so if I add the object through the edit object tab it will start on any random frame not the first. Is there any way I can make it so that it starts on the first frame every time I add the plane.
PLMK,
you could use a python script to add the object,
on the object, make the animation connect to the always and a property sensor.
when the property is true, play anim (loop end).
on the python script use
controller = GameLogic.getCurrentController()
addobject = controller.actuators[“addobject”]
object = addobject.objectLastCreated
if conditions here to add object:
object[“property”] = True
No, it’s an odd thing with sprites in the bge he’s referring to(I believe). The sprite animation is global for that object, so when you end the game engine, whatever frame the sprite was on, it will start at once started again.
And if you add multiple of the same object through the “Add object” actuator, they will all be on the same frame at once.
The only thing I know of that fixes the first problem is the “Explosion.py” from Squish the Bunny. Maybe that one dude’s UV scroll script could do it, but that’s about what explosion does.
You should set the UV-coordinates of each face (or the only face, if there’s only one) back to the original UV-coordinate points, if that’s what you need to do. If you’re talking about an explosion based on a sprite, then you should use more than one explosion (use several and cycle through them if the ‘current one’ is in use).