Sprite animation with "overlapping" animations? I'm trying to implement my own sprite animation system, and so far I've got it working quite nicely. I store each animation as a "take" which basically denotes the row of the animation in the sprite sheet, the starting frame and the number of frame. These takes are created during start up and played by calling play(takeID) on the animation. The player is split into four sprites head, torso, arms and legs, and different animations can be played on each of these separately from the other parts. Now, this works fine for situations where I only need a single animation (walking, idling, running, swinging a sword etc.), but I need a more complex animation system for situations where the player performs multiple things at the same time, for example walking while swinging a sword. I've tried to break down the requirements of the animation system by using the example above, and I've found these cases 1. Player swings the sword 1.1. Play swinging animation 1.2. When done, play idle animation 2. Player starts walking 2.1. Play walking animation until player stops 2.2. Play idle animation when player stops 3. Player walks and swings the sword 3.1. Play walking animation 3.2. Replace the animation of the hands by a swinging animation 3.3. When swinging animation is done, revert back to the "walking hands" animation 4. Player walks, initiates a swing and stops walking during the swing 4.1. Play walking animation 4.2. Replace the animation of the hands by a swinging animation 4.3. (Player stops walking during the swing) 4.4. Stop walking animation and play idle animation for all other body parts except the hands 4.5. When swinging animation is done, play idle animation for hands I've tried fiddling around with "overriding" animations where the animation with the higher priority (in this case, the "swinging" animation) would be shown instead of the lower priority animation (the walking animation) while updating still both simultaneously to maintain the correct rhythm of the original animation. However, I have trouble getting it to work properly. The "reversion to idle animation" is a rather challenging task if I have just the single walking animation, I can stop it and then play the idle animation (or rather, the "idle frame"), but when the sword swinging is added, it becomes more difficult to know when to swap to the idle animation. So, to conclude with my question has anyone faced a similar problem? How should I tackle this issue?


Animations won't transfer states until entire animation is completed I am following the survival shooter tutorial and am using Unity 5. I just completed this video (linked) and I tested played it to see my animations worked but it seems like it will only transition from idle to walking after the entirety of the idle animation completes. The idle animation is quite long so my character will move around when it looks like its idling since the movement responds right away. Did I mess up something in my transitions? I followed the directions exactly and didn't change anything in the inspector that I wasn't told to do.


Why (SDL) animated filled circle leaves trail of movement? I'm trying to achieve proper animation using SDL. Used flags are SDL HWSURFACE and SDL DOUBLEBUF. That what I'm getting is technically smooth (I think), but I can figure out what should I do to remove that trail? My animation is time based (I'm calculating displacement with delta time). Link to to video https vimeo.com 62065078 my (every frame) drawing function is like for(int x 0 x lt screen gt w x) for(int y 0 y lt screen gt h y) draw pixel(screen, x, y, 136, 136, 136) and ball filledCircleColor(screen, ball.x, ball.y, 17, 0x000000ff) and finally SDL Flip(screen) main loop is for( ) curr ts stopwatch seconds elapsed(sw) d time curr ts prev ts prev ts curr ts cpSpaceStep(space, d time) draw scene(screen)


Unity animation won't play on trigger. What do I do to fix it? Ok so I added a play animation line to my trigger script. I made an animation, added it to the trigger object, attached the animation to the trigger, and tested. The target goes to the trigger as it should, deletes the trigger, but the animation never plays. So I check the console, and it's telling me "The AnimationClip 'MazeDoorClose' used by the Animation component 'SuckInTarget' must be marked as Legacy." so I do that, but now the trigger activates before the target gets there, and there is still no animation playing! I know this sounds confusing so in an attempt to make it easier to understand I made a short video . Sorry for the crappy quality, but hey it's free. Here is the code using UnityEngine using System.Collections public class SuckIn MonoBehaviour public Transform target public float speed public string ObjectWithTagToBeDestroyed public string ThingToAnimate void Update() float step speed Time.deltaTime target.position Vector3.MoveTowards(target.position, transform.position, step) void OnTriggerEnter(Collider coll) if (coll.gameObject.tag "Ball") Destroy(GameObject.FindWithTag(ObjectWithTagToBeDestroyed)) GetComponent lt Animation gt ().Play(ThingToAnimate) Before you ask yes the animation is on the object as it should be, and as Unity told me to do I marked it as a legacy animation. Any ideas what am doing wrong?


Frame Interpolation issues for skeletal animation I'm trying to animate in between keyframes for skeletal animation but having some issues. Each joint is represented by a quaternion and there is no translation component. When I try to slerp between the orientations at the two key frames, I got a very wacky animation. I know my skinning equation is right because the animation is perfectly fine when the animation is directly on a keyframe rather than in between two. I'm using glm's built in mix function to do the slerp, so I don't think there are any problems with the actual slerp implementation. There's really one thing left that could be wrong here. I must not be in the correct space to do slerp. Right now the orientations are in joint local space. Do I have to be in world space? In some other space along the way? I have the bind pose matrix and world space transformation matrix at my disposal if those are needed.


Workflow for non human ragdolls So I want to make automatic ragdoll generation system for all my enemies in my game, the assets are already made and have been paid for a while ago so I can't really ask the artist to change anything or generate some extra info, they are a variety of models (humans, robots, beasts) with a hard limit of 32 bones. Each bone is labelled and there is only a single mesh provided, which is skinned and ready to go. I am trying to understand how an automated system can generate ragdolls from this. So far my idea involves convex decomposition (v hacd?) to split up the mesh into small convex hulls and attach them using hinge and cone twist constrains (in bullet physics). The idea sounds simple in my head but actually there are so many questions such as, how to do it automatically? how to make each convex hull be attached to a bone correctly? how to join the convex hulls with constraints in the correct place? the ragdoll would be generated from the bind pose, but how to transform the ragdoll so that it is perfectly aligned with the skeleton after its death animation? I would very much appreciate some guidance on this, thanks.


What animation technique is used in 'Dont Starve'? While playing a few games in my personal time off development I've stumbled across a survival 2D 3D survival game. The game was apparently made in SDL and GLUT (Dont starve) but what really amazed me was the animations in the game. The animations are extremely smooth and fluent. There is no distortion while animating, what usually happens in hand made animations is that pixels get removed, animations are jaggy and they simply aren't as smooth. That got me thinking on how they managed to accomplish such a quality of animations. Were they really handmade (If they were, then it must've taken a very talented artist), is it bone animation or are they using another technique?


How to resolve "Accessed None trying to read property" error? Whenever I finish running the project, this error message appears Blueprint Runtime Error "Accessed None trying to read property jogador". Blueprint Jogador BP Anim Function Execute Ubergraph Jogador BP Anim Graph Transition Node Result By clicking to know where the error is coming from, the program tells me this code This is the code I made to get the player reference (jogador player Animation Blueprint) This is basically for the transition code between animations, to receive information whether or not the player is jumping (jogador player Blueprint) Animations perform normally, so the error doesn't seem to compromise project execution, but why does it occur? I looked at some links, but I don't know how to remove it. https forums.unrealengine.com development discussion blueprint visual scripting 86607 accessed none trying to read property


Objective C Moving UIView along a curved path I'm not sure if I am approaching this the correct way. In my app, when a user touches the screen I capture the point and create an arc from a fixed point to that touch point. I then want to move a UIView along that arc. Here's my code ViewController.m method to "shoot" object KIP Projectile creates the arc, KIP Character creates the object I want to move along the arc ... get arc for trajectory KIP Projectile vThisProjectile KIP Projectile alloc initWithFrame CGRectMake(51.0, fatElvisCenterPoint 30.0, touchPoint.x, 60.0) vThisProjectile.backgroundColor UIColor clearColor self.view addSubview vThisProjectile ... KIP Character thisChar KIP Character alloc initWithFrame CGRectMake(51, objCenterPoint 5, imgThisChar.size.width, imgThisChar.size.height) thisChar.backgroundColor UIColor clearColor thisChar.charID charID thisChar.charType 2 thisChar.strCharType "Projectile" thisChar.imgMyImage imgThisChar thisChar.myArc vThisProjectile thisChar buildImage thisChar traceArc in KIP Projectile I build the arc using this code (CGMutablePathRef) createArcPathFromBottomOfRect (CGRect) rect (CGFloat) arcHeight CGRect arcRect CGRectMake(rect.origin.x, rect.origin.y rect.size.height arcHeight, rect.size.width, arcHeight) CGFloat arcRadius (arcRect.size.height 2) (pow(arcRect.size.width, 2) (8 arcRect.size.height)) CGPoint arcCenter CGPointMake(arcRect.origin.x arcRect.size.width 2, arcRect.origin.y arcRadius) CGFloat angle acos(arcRect.size.width (2 arcRadius)) CGFloat startAngle radians(180) angle CGFloat endAngle radians(360) angle CGMutablePathRef path CGPathCreateMutable() CGPathAddArc(path, NULL, arcCenter.x, arcCenter.y, arcRadius, startAngle, endAngle, 0) return path (void)drawRect (CGRect)rect CGContextRef currentContext UIGraphicsGetCurrentContext() myArcPath self createArcPathFromBottomOfRect self.bounds 30.0 CGContextSetLineWidth(currentContext, 1) CGFloat red 4 1.0f, 0.0f, 0.0f, 1.0f CGContextSetStrokeColor(currentContext, red) CGContextAddPath(currentContext, myArcPath) CGContextStrokePath(currentContext) Works fine. The arc is displayed with a red stroke on the screen. In KIP Character, which has been passed it's relevant arc, I am using this code but getting no results. (void) traceArc CGMutablePathRef myArc myArc.myArcPath Set up path movement CAKeyframeAnimation pathAnimation CAKeyframeAnimation animationWithKeyPath "position" pathAnimation.calculationMode kCAAnimationPaced pathAnimation.fillMode kCAFillModeForwards pathAnimation.removedOnCompletion NO pathAnimation.path myArc CGPathRelease(myArc) self.layer addAnimation pathAnimation forKey "savingAnimation" Any help here would be appreciated.


Inverse kinematics behaving weirdly I have been trying to figure out why my player character crouches like this when I use inverse kinematics on it. I followed this tutorial https docs.unity3d.com Manual InverseKinematics.html? ga 2.157285243.1916573353.1569208906 694809292.1561053348 but then the weirdness in the picture above happens. What is going on? In case It helps, I used makehuman to make the player model, and used its "Game Engine" rigging option. EDIT Here are some additional pictures after I remade the project I left look obj blank because all it does is makes the player's head look a certain direction.


The animation state could not be played because it couldn't be found! If I try to use animation.Play() or have Play automatically ticked in the inspector on the animtion object, it gives me the follwing error The animation state could not be played because it couldn't be found! I searched around the web and everywhere they say you need set the animation type to 'legacy', but I already changed type to legacy and it did NOT fix the problem. Thanks in advance.


How can I make the Player animation appear smooth? I'm using GLFW for my window and input related work. I'm calculating delta time and multiplying it with my player speed and then finally adding it to the current position of the player. The thing is that, though it makes my motion frame independent the player movement appears to slow and speed up interchangeably. Well the reason would be the different values of delta time at each frame. What should I do to smooth out this animation? Here is the relevant code, and a capture of what's going on float deltaTime 0 float oldTime 0 The direction in which the player will move int playerX 0 int playerY 0 callback method for keyboard events void keyboard callback(GLFWwindow window, int key, int scancode, int action, int mods) if (key GLFW KEY W amp amp action GLFW REPEAT) playerX 0 playerY 1 if (key GLFW KEY S amp amp action GLFW REPEAT) playerX 0 playerY 1 if (key GLFW KEY D amp amp action GLFW REPEAT) playerX 1 playerY 0 if (key GLFW KEY A amp amp action GLFW REPEAT) playerX 1 playerY 0 update player's position void update() player gt move(playerX, playerY, TIME PER FRAME) set up glfw keyboard callback function and other stuff void init() glClearColor(0, 0, 0, 0) player gt bindVertexAttributes(shader.getAttributeLocation("position")) glfwSetKeyCallback(window gt getGLFWWindow(), keyboard callback) wait logic float expected frame end glfwGetTime() TIME PER FRAME void wait() while (glfwGetTime() lt expected frame end) expected frame end TIME PER FRAME playerX playerY 0 rendering function void render() glClear(GL COLOR BUFFER BIT GL DEPTH BUFFER BIT) player gt setUniformMatrixLocation(shader.getUniformLocation("projectionMatrix"), shader.getUniformLocation("transformationMatrix")) shader.useProgram() update() player gt render() wait() shader.stopProgram() main function int main(int argc, char argv) init() main loop while (!glfwWindowShouldClose(window gt getGLFWWindow())) render() window gt swapBuffers() glfwPollEvents() glfwTerminate() return 0


MoCap data files applied to avatars using Mecanim I am applying some animations (e.g. running) from this free MoCap package that I got off the Unity Assets Store, and as far as I can see from running the animation previews, they seem fine (i.e. playing smoothly) but once I apply them to my avatar (generated through the free AutoDeskCharacterGenerator) and I run the animation, the avatar seems to rise on the floor... Please see the attached images that illustrate the character (with its collider, etc...) initially being perfectly aligned (touching the ground) but then a few seconds into running, it has been lifted off the ground. At first, I thought this must be due to the recorded motion data files, but (1) it has happened in every animation I have tried from the package so far, and (2) these motion data files were recorded off real people, so I find it unlikely that all the performers happened to be moving around on very uneven surfaces and slopes. Has anybody come across this problem before?


How should i manage intro animation never realized how the animation intro of a game is done, I've thought that perhaps you have all the images of each frame of the animation, or have a video made and make the load. anyway, if it is made of any of these ways, What is the best way to do this?


How to add custom control shapes to a rig in Maya I find most Maya animation videos has these circle lines to control character part rotation Why does my imported fbx not have these circle lines?


How do I render an animation where some frames appear twice? I am animating a sprite. The sprite has 7 different frames, but the animation is 10 frames long. This is because 3 of the original frames appear twice in the animation 3 gt 4 gt 5 gt 6 gt 4 gt 3 gt 2 gt 1 gt 0 gt 2 Frames 2, 3 and 4 appear twice. This avoids having to store duplicate frames in the spritesheet. How can I render the animation in this sequence with repeated frames?


Character on Character fighting animations sorry about the vague title, but these couple of videos images might explain my situation a bit better https www.youtube.com watch?v MG1mNyjNuXk (Wolfenstein the Old Blood) https www.youtube.com watch?v NVmsucYKlvo (Mad Max the Game) https www.youtube.com watch?v XYWQ UzTpZ8 (at 0 49 seconds, Credits go to Ranon Sarono AKA Hyper) I am basically wondering how you would animate the 2 characters if 1 of them knifed the other one, do they both have their separate animations? or do they just take the animation file?


Problems with imported model animation from Blender to Unity I've downloaded a free sculpted arm and created my own rig and animation for it in Blender. So here is how it looks like in Blender And the model itself looks fine in Unity, but as soon as the animation starts, the vertices are partially glued together like this I've simply imported the .blend file for the moment, is there some better way to import this?


How to implement scene changing in real time? I want to implement real time scene changing effects to make my game could changing from spring to summer, summer to fall, fall to winter. And Chaning effects like this game. Giana Sisters. I think Giana Sisters use animation to transit from two scenes, but I dont know how to make these animations. Is any other suggestions could make this effects?


how to use .getTransform to get the current coordinates of translated rotating object I m stuck trying to figure out how to use .getTransform to determine what pointA (x1,y1) and pointB (x2,y2) of each of my lines would be after translate and rotate. I've found other answers but they don't seem to target exactly what I need nor do I fully understand the matrix that gets returned. From the snippet provided you can see that my lines always return their original values. I know there's a formula for this, or a way to use the matrix, I just don't know it or how I would implement it. What I need is the start and end points of every line. The plan will be to rotate (animated spinning) them to any angle and have those coordinates get used for ray casting. I've previously done this from a center point out or one direction to another but not with so many lines using the rotate method. I have tried the same thing with boxes and just can't seem to grasp how I can get the rotated coordinates. Here's the snippet let canvas document.getElementById("canvas") let ctx canvas.getContext("2d") canvas.width 200 canvas.height 180 class Rays constructor(x1, y1, x2, y2) this.x1 x1 this.y1 y1 this.x2 x2 this.y2 y2 draw() ctx.save() ctx.translate(canvas.width 2,canvas.height 2) ctx.rotate(45 (Math.PI 180)) ctx.beginPath() ctx.strokeStyle 'black' ctx.moveTo(this.x1, this.y1) ctx.lineTo(this.x2, this.y2) ctx.stroke() ctx.closePath() ctx.restore() let rays function createRays() due to translate i have to push some lines in the negative and some positive this causes an overlap of one line in the center. for (let i 0 i lt 26 i ) let x1 i lt 13 ? 10 i i 10 canvas.width 2 20 let y1 canvas.height let x2 i lt 13 ? 10 i i 10 canvas.width 2 20 let y2 canvas.height rays.push(new Rays(x1, y1, x2, y2)) enter angle here createRays() let count 0 just used to stop it from constantly console logging rays.x1 function drawRays() for (let i 0 i lt rays.length i ) rays i .draw() count lt 1 ? console.log(rays i .x1) false count drawRays() console.log(ctx.getTransform()) function animate() ctx.clearRect(0, 0, canvas.width, canvas.height) ctx.fillStyle "lightgrey" ctx.fillRect(0,0,canvas.width,canvas.height) drawRays() requestAnimationFrame(animate) animate() lt canvas id "canvas" gt lt canvas gt


Can't attach animation to script I'm working on a little game (which is also my first one) and I want to insert a splash screen at the beginning (after the Unity one). I've finally achieved to add a fade in and a fade out transistion when the splash screen starts and ends, but the fade out is activated by a button and I wont to play it simply after a certain time. I've made a script for that using UnityEngine using UnityEngine.UI using System.Collections public class FadeInOut 2 MonoBehaviour public Animation anim IEnumerator Start() yield return new WaitForSeconds(2f) anim.GetComponent lt Animation gt ().Play() Application.LoadLevel(Application.loadedLevel 1) The problem is when I try to attach the animation the Inspector refuses to do it. Any ideas? Thanks


Exporting distinct images from a sprite sheet using GIMP I have recently found that in Photoshop there is a script that enables you to export individual images on different layers into distinct png images on disk. Is it GIMP capable of doing the same thing and how? I have a sprite sheet (png image) and there are 36 perfectly aligned images in 4 rows (64x64 pixels each). I have to cut and export 36 times. Can be GIMP of some help here? I don't have Photoshop.


Need to produce an animated texture of Water where each image tiles in all directions I need to produce a 2D 'animated' texture of "water" for a game in which each image tiles in 'all' directions, much like those produced by the Caustics Generator, but with the power and flexibility of something the likes of Blender. The final result from Caustics Generator is 32 images that are actually animated such that when the full 32 images are played in a loop they will seamlessly loop forever. They will not only loop in time, but each image also tile in all directions. This is nice, but it comes in only one flavor so to speak. I'd like to accomplish the same thing with a Blender type tool, and I have actually gotten to the point where I generate the X number of images, but they do not tile in 'all' directions, nor are they slightly animated. I've tried Blender texture animations using offsets but with only limited success. Does anyone know of how to (or of a tool) which will animate textures such that they tile in all (4) directions? Many thanks in advance ....


FPS Android game that moves the gun as user swipes the screen I am Making a First Person shooter game for android. Gun moves in all directions I swipe left right up or down. But the speed is so slow. How can i increase it's Speed.Here is my code. void FixedUpdate () foreach (Touch t in Input.touches) if (t.phase TouchPhase.Began) initialTouch t else if (t.phase TouchPhase.Moved amp amp !hasSwiped) float deltaX initialTouch.position.x t.position.x float deltaY initialTouch.position.y t.position.y distance formula distance Mathf.Sqrt((deltaX deltaX) (deltaY deltaY)) bool swipeSideways Mathf.Abs (deltaX) gt Mathf.Abs (deltaY) if (distance gt 100f) if (swipeSideways amp amp deltaX gt 0) this.transform.Rotate (new Vector3 (0, 30f, 0), rotationSpeed Time.deltaTime) else if (swipeSideways amp amp deltaX lt 0) swipe right this.transform.Rotate (new Vector3 (0, 30f, 0), rotationSpeed Time.deltaTime) hasSwiped true else if (t.phase TouchPhase.Ended) initialTouch new Touch () hasSwiped false


Why does exporting to FBX in 3dmax loses simulated animation I made a cloth simulation (wind blowing a cloth). When I export it to FXB and the animation box is ticked on export menu it seems ok (no error in longs). When I reload it to Unity. or 3DMAX again. The wind animation is lost. How can I fix that? Thanks


Rigging Skinning of human skeleton skin mesh scanned by MRI I have successfully developed a system in Qt C for human musculoskeletal mocap simulations. I can run asf, amc, bvh motion capture files and can visualize the joint transformations. I even simulated the static rigid bones of MRI scanned meshes. 31 mesh bones were extracted from MRI data and each bone is assigned to .asf skeleton bone id name and parent and child relationship is created. I have absolute and relative transformations of each bone and the bone mesh vertices positions are also known. Now there is a skin mesh over the skeleton bones. I want to do rigging skinning of that skin mesh with the bone transformation. If a bone transforms, its skin mesh should be transforming too. Literature study tells us that, assign each vertex of its bone and assign some weight to each vertex, sum up all and multiple with the bone's transformation matrix, etc. etc. and find the new position of a vertex. I have pretty much experience to play with meshes and transformations, I can do that. But here I do not get the concept, first of all, how can we assign vertex to its specific bone? because human skin is a continues with Only One Shell, do we assign by computing the offset minimum distance from bone to skin? Second question is how do we compute weight for each vertex? Because this mesh is not exported from MAYA or some 3D softwares, where each vertex is assigned with a weight value, but this is a static rigid mesh with no precomputed information. Third question comes to mind that how can we know that this specific vertex should be transforming with the transformation of Foot for example? How do we know that this vertex is a Foot vertex? I want to have some concepts about the methodology, please guide me. Thanks.


How do I support animation with frames of different sizes? I'm trying to create a simple top view 2D rpg, in the style of Zelda and Secret of Mana, using PyGame. I've managed to make the beginnings of a game, with an animated character walking around. However, when I start animating attacks, I'm running into problems because the sprite with the sword slash is bigger than the walking sprite. This makes the character appear to be jumping around when attacking. I managed to handle the problem by defining a center of gravity, so to speak, for each image, and apply a suitable offset at each frame in the animation to make the center of the character stay at the same place throughout the animation. I defined a dictionary of lists of images (instances of pygame.Surface), where I pick out the correct list by the state of the character, so for example there is one list for walking left, and then I loop over the list to get the animation. To handle the offset, I similarly created a dictionary of lists of offsets, looping over those in the same way. However, I'm not entirely pleased with this implementation, so I'm looking for a more elegant solution. I tried to add an attribute called offset to each instance of the pygame.Surface class, to hold the offset for each image, but the Surface class doesn't allow new attributes to be set. I then thought about subclassing pygame.Surface, which would allow me to set any attribute I wanted, but then I couldn't load my images with pygame.image.load without a lot of extra code. I imagine everyone who makes a game with animations where the size of the sprite changes between frames would have to deal with this problem, so if anyone could suggest an elegant implementation, that would be great. If example code with PyGame is available, that would be even greater.


Head bone not found when importing .blend to Unity I have created a model, rigged it(using rigify), and created several actions(animation clips) for it Blender. Everything seems to be fine. However, when I import the .blend to Unity I get a console warning that "Required human bone 'Head' not found". I know that there is a bone called "head" in my .blend. The animations work, except the head rotation does appear to not be deforming. Has anyone experienced this? Is this just a naming convention thing. Should I try to rename my "head" bone to "Head"? I just don't know the inner workings of the the import process well enough to know what to do.


Creating Smooth Animations Possible Duplicate What s the best way to create animations when doing Android development? What animation technique is used in Dont Starve ? I've always admired Zeptolab for their smooth in game animations. Zeptolab has created both Cut the Rope and now Pudding Monsters. I'm wonder how you're able to get animations this smooth? Are these sprite sheets? Are they actual 3D models? Here's a video of their latest game http www.youtube.com watch?v rV1dlN dbJQ If you get to the game play you'll see how the guys are constantly wiggling and it's so smooth. You also saw this in the monster guy in Cut the Rope. I'm just wanting some insight into how this is done. Like what tools they may be using. Thanks


Should I use procedural animation? I have started to make a fantasy 3d fps swordplay game and I want to add animations. I don't want to animate everything by hand because it would take a lot of time, so I decided to use procedural animation. I would certainly use IK (starting with simple reaching an object with hand ...). I also assume procedural generation of animations will make less animations to do by hand (I can blend animations ...). I want also to have a planner for animation which would simplify complex animations those which can be split to a sequence run and then jump, jump and then roll or which are separable legs running and torso swinging with sword . I want for example a character to chop a head of a big troll. If troll crouches character would just chop his head off, if it is standing he would climb on a troll. I know that I would have to describe the state ("troll is low", "troll is high", "chop troll head" ..) which would imply what regions animation will be in (if there is a gap between them character would jump), which would imply what places character can have some of legs and hands or would choose an predefined animation. My main goal is simplicity of coding, but I want my game to be looking cool also. Is it worthy to use procedural animation or does it make more troubles that it solves? (there can be lot of twiddling ...) I am using Blender Game Engine (therefore Python for scripting, and Bullet Physics).


Who should handle animations when game logic is separated from rendering? Suppose I have a tile based game and I want the step to be 1 tile but also want the movement to be smooth while the player is getting there. If I understand correctly, the only way to achieve this would be making a series of small movements where the increment is a percentage of a tile. My question is should the game logic thread send the animations to the rendering thread? What is the best way to go about it?


How do I make a 2D sprite flash green when tapped? I have a sprite that is based on an image of a gray circle. When the user touches the sprite, I want the sprite to flash green, as in I want the circle to appear to turn green for 0.2 seconds. I tried setting the color of the sprite via SpriteRenderer's function SetColor, and it blended the color with the initial gray color of the sprite, so I got a very dark green even though I'm really sure I didn't mess up the values when I created the color. Now I'm trying to get my flashing effect by using separate images. I have the images I need, and I have a message getting logged when I tap the circle, I just need to setup a non looping animation and trigger that animation in my code.


Are the Minecraft animations hardcoded into the game? I would like to know how the animation system works in minecraft. I get a feeling that all the mobs are hardcoded into the game. Did notch really sit there and create the matrices for all the animation bones by hand? I like recreating games for fun, so I would like to know how he did this. Also, if he truly does hardcode them... is there a better way?


Calculating the correct roll from a bone transform matrix Read this forum topic for more info http blenderartists.org forum showthread.php?260602 transform matrix to bone 28head tail roll 29 bug I'm trying to get my Blender3d modeller importer to create correct bones from my file's transform matrices. The Blender Python API doesn't have a way to do this (anymore!), so people had to dig the Blender C source to find out how Blender does it and port that. Here's a Python port of the needed functions, not by me (I don't know C) def vec roll to mat3(vec, roll) target mathutils.Vector((0,1,0)) nor vec.normalized() axis target.cross(nor) if axis.dot(axis) gt 0.0000000001 this seems to be the problem for some bones, no idea how to fix axis.normalize() theta target.angle(nor) bMatrix mathutils.Matrix.Rotation(theta, 3, axis) else updown 1 if target.dot(nor) gt 0 else 1 bMatrix mathutils.Matrix.Scale(updown, 3) rMatrix mathutils.Matrix.Rotation(roll, 3, nor) mat rMatrix bMatrix return mat def mat3 to vec roll(mat) vec mat.col 1 vecmat vec roll to mat3(mat.col 1 , 0) vecmatinv vecmat.inverted() rollmat vecmatinv mat roll math.atan2(rollmat 0 2 , rollmat 2 2 ) return vec, roll How to use them pos mymatrix.to translation() axis, roll mat3 to vec roll(mymatrix.to 3x3()) bone armature.edit bones.new('name') bone.head pos bone.tail pos axis bone.roll roll Sadly, it seems even the Blender C code is buggy and doesn't take into account cases when the bone is parallel to (0,1,0). So such bones can get assigned wrong (by 180 degrees) rolls and mess up animations. Does anyone have better code for generating roll which takes into account such cases? The old Blender 2.4 API generated correct ones. Its C code can be found here http svn.blender.org svnroot bf blender branches blender 2.47 source blender blenkernel intern armature.c I'm no C coder myself, again.


How do character object interaction animations work in isometric games? I am planning an isometric business simulation game where the player sees an office with the usual furniture such as desks, whiteboards etc. Characters (Staff NPC's) within the game should interact with these objects by performing some pre defined tasks such as typing on the keyboard at the desk or writing on the whiteboard etc. What I am interested in, specifically, is the following scenario Character moves across the office (1) to his desk (2) and sits down and starts to type (3). From what I understand I would have a sprite sheet for the character movement (1) and a static sprite for the desk (2) but I don't quite understand how the third step would be handled? Is there a combined sprite that contains both desk and character? I assume not, otherwise I would need to have a sprite sheet for every desk and character combination. How is this normally handled? EDIT Here is a specific example animation from the game Theme Hospital. You can see the video here. As far as I can see the animation is split into several steps. Step 1 Character moves between desk and chair. This suggests that chair and desk are in fact separate sprites. Step 2 Character sits down animation Notice how in the very last frame the chair is closer to the desk. Step 3 Desk animations Step 4 Stand up animation Is the same as sit down but played in reverse. Step 5 Move away Use normal move animation to move away. The questions I have is how are these animations best separated and how would a graphic artist usually provide these animations? Is the character sitting and typing on the desk actually three different sprites (desk, character and chair)? Does anyone know any example sprites of similar animations? EDIT 2 I guess my biggest concern is that I have the right expectations on how the sprites will actually look like. I can't draw them myself so I will have to pay someone to do it and I assume there is some kind of best practice way to do these kind of animations?


Why should a FPS game use a "floating arms" approach over full body one? I've seen many first person shooter games both single and multiplayer using a set of floating arms and a gun instead of using the whole body model. What is the advantage of floating arms? You are technically doubling the work making two meshes and two animations for each action.


How do I show a small sprite being dragged by touch? In my mobile game, users drag shapes across the screen. Think of it as a classic Lines game, where you drag a dot on the field, or a chess game where you drag and drop pieces. The problem is that the player's finger totally covers the sprite, making dragging confusing. Is there a common practice to solve this? My best try so far was to move the sprite to be offset from the finger when the dragging starts, then move along with the finger in the offset position until dropped. The problem with this approach is that users might be left or right handed. If I offset the sprite to the top left of the finger, dragging with the left hand covers the sprite again.


Blending effect on textures Hi i am trying to build screen animation like flickering, interlace, color separation similar to old style malfunctioning Amiga screens. The intended effects are shown in this video. I am using libgdx and I already discovered the universal tween engine, which helps a lot to build transitional animations, but how should I approach those blending effects, any suggestions? I will specify my question once I learned more about libgdx, but maybe you could give me some hints already. Thanks!


Guidelines when rigging a character Just wondering that how many IK (Inverse Kinematic) bones should you apply to a game character before it starts to go resource hog. Basically should you try to get rid of IK bones and just try to animate without them but using IK bones makes things easier for the animator but might cause unnecessary use of resources and possibly cause bottleneck when calculating bone and mesh translations. I'm using Blender and couple of animation tutorials are suggesting to use IK controllers and they indeed help a lot but when importing the character into a game they might be plain pointless since they are used only to help the animator.


Player sprite moving slower on iPhone 4 I just finished getting movement jump animation for a player sprite in Xcode using Cocos2D. The basic movement algorithm is a timer that updates every 0.01 sec, changing the sprite position to (sprite.position.x xVel, sprite.position.y yVel). Each time a movement button is tapped, the appropriate velocity (initialized to 0) is changed to whatever speed I choose, then a stop movement button returns the velocity to 0. It's not an ideal solution but I'm very new at this and stoked to at least have that working with little help from the internet. So I may not have explained that perfectly, but it is in fact working to my satisfaction in Xcode's iPhone Simulator, however when I build it for my device and run it on my phone, the sprite's movement speed is noticeably slower than in Xcode. At first I thought it must have to do with the resolution of the iPhone 4, making the sprite's movement path twice as long, but I found that if I pull up the multitask bar, then return to the app the speed will sometimes jump back to normal. My second theory was that the code is just inefficient and is bogging the processes down, but I would see this reflected in the frame rate wouldn't I? It stays at 59 60 the whole time, and the spritesheet animation runs at the correct speed. Has anyone experienced this? Is this a really obvious issue that I'm completely missing? Any help (or tips for optimizing my approach to movement) would be much appreciated!


Which style technique is more time efficient for an inexperienced artists? For a top view 2D mobile game where you have to create and animate humanoids (human, golems) and "objects" like fire, boulders, levers, etc. Considering the artist has no prior experience with drawing, nor with any related software.


Should I use animation or simple object rotation in this case I'm making game where players control hover tanks using Unreal Engine 4. Tank have a turret which rotates around for aiming. Turret pivot center of mass is not exactly in joint with rest of tank so it rotates around point behind the turret. You can see it here https www.youtube.com watch?v 2k d4u6Htzg I asked my friend who made this mesh to create skeleton for it. Now I'm not sure, which is the best way to implement correct rotation. Should I make and use animation of tower rotating? Keeping turret as child of rest of tank and simply rotating it was easier and more straightforward, so maybe I should just change pivot position? Maybe, there is some easy way to rotate turrent around bone? Which way is best in Your opinion and why?


why animated tiles aren't animated? So I got some code and I'm using pytmx to load the maps, but the animated tiles don't seem to animate in my pygame game. Is there a setting to change that or do I need to write the animation code myself?


How to add (not blend) non looped animation clip to looped animation with Mecanim? I have a GameObject with Animator and looped animation clip. This animation changes X coordinate from 0 to 10 and back. I need to add another animation to the first one that increases GameObject's scale and changes its color to red simultaneously. After scale and color change GameObject keeps these parameters and continues to move according to the first animation clip. The only way I managed to work it around is writing a custom script with couroutine IEnumerator Animate() float scaleDelta 0.2f float colorDelta 0.02f for (int i 0 i lt 50 i ) spriteRenderer.color new Color( spriteRenderer.color.r, spriteRenderer.color.g colorDelta, spriteRenderer.color.b colorDelta) transform.localScale new Vector3( transform.localScale.x scaleDelta, transform.localScale.y scaleDelta, transform.localScale.z) yield return new WaitForSeconds(0.02f) This works for linear interpolation, but requires to write additional code and write even more code for non linear transformations. How can I achieve the same result with Mecanim? Sample project link https drive.google.com file d 0B8QGeF3SuAgTU0JWNGd2RnpUU00 view?usp sharing


How to animate infinite rotary movement I would like to add a chainsaw (or something similar to it... a rotary blade) to my game as a melee weapon. In fact, a rotary blade is a better example. Would it be better to do it in blender somehow, using skeleton, or should I just create two parts (the handle and the blade) and then rotate it in UE4?


Creating a large amount of sprites and animations For my AP U.S. Government and Politics class, I am making a spinoff of Mortal Kombat. Because of time constraints, I'm using an open source version of the game and want to create new characters. I have about two weeks to do the project and can invest about 1 4 hours most days. I want it to look as nice as it can with the limited knowledge, skill, and time that I have. What programs or techniques would be best for a beginner with my time constraint?


Blender to UE4 eye mesh is getting detached I've created a rigged and animated mesh using MakeHuman and Blender and exported it as FBX file to be used in Unreal Engine, all seems to be working well except the eyes. I've tried parenting the eye mesh to the head bone which works fine in Blender but unfortunately doesn't work with Unreal Engine. My second approach was to create a bone for each eyes and parent the eye mesh with weights which is better but it's still doesn't work as it shows in blender. In Blender 2.82 ( works through out the animation ) In UE4 4.24.3 ( sometimes the eyes are inside the body, sometimes it pops outside, never in the right place. )


How to transition between states and mix states in a finite state machine? I don't understand how to use a finite state machine with the entity controlled by the player. For example I have a Mario style game (2d platform). I can jump, run, walk, take damage, swim, etc. So my first thought was to use this actions as states. But what happens, if you are running when you take damage? Or jumping, taking damage and shooting at the same time? I just want to add functionalities (actions) to the player in a clean way (not using it for all the actions in the entity update) .


How do I convert a Source engine NPC model to a player model? The Source engine's NPC and player models differ An NPC model applied to the player has no animations. It cannot walk and holds its arms out to the side by about a foot. The weapon is held in the right hand and you can see the player switch weapons, but the weapons also have no animation. How do I convert between these model types?


Unity Network Animations Not Smooth I am attempting to learn Unity Networking using the new UNET framework. I have a functioning rudimentary 3rd person setup in which a host and a client can connect to localhost 7777. Animations are working across both client and host. However, some of the animations are not smooth. I am using the ThirdPersonAnimationController and the Ethan model that come with Unity. The animations from running to turning left or right and from running to stopping are quite jittery. However, they are not jittery when viewing the screen in which the controls are being input. I am using the NetworkManager and my Player prefab has a NetworkAnimator. I'm calling my movements in the Update function of my Player script void Update() param anim.parameters if (!isLocalPlayer) return float move Input.GetAxis("Vertical") anim.SetFloat("Forward", move) float moveTurn Input.GetAxis("Horizontal") anim.SetFloat("Turn", moveTurn) Camera.main.transform.position new Vector3(transform.position.x, 2, transform.position.z 2.5f) public override void PreStartClient() GetComponent lt NetworkAnimator gt ().SetParameterAutoSend(0, true) GetComponent lt NetworkAnimator gt ().SetParameterAutoSend(1, true) GetComponent lt NetworkAnimator gt ().SetParameterAutoSend(4, true) public override void OnStartLocalPlayer() good for initializing things only for the local player cameras, input, etc... GetComponent lt NetworkAnimator gt ().SetParameterAutoSend(0, true) GetComponent lt NetworkAnimator gt ().SetParameterAutoSend(1, true) GetComponent lt NetworkAnimator gt ().SetParameterAutoSend(4, true) Is there a way to improve the animation across the network? Any suggestions would be very helpful. Thanks.


What technique would I use to animate a 2D curling tentacle? I have played around in Cocos2D X and I think I understand the limitations of sprite based animation fairly well. I want to have a game with some characters curling and extending a tentacle which varies in length and amount of curl depending on the terrain. Maybe imagine a sloth swinging from a tree but with arms that stretch at times (Gumby character?). Is there a name for such a technique? Would this be a variant on Animating Bezier Curves as seen in Jason Davies's example or discussed in this blog on tweening control points? I'm a very experienced polyglot programmer but relatively naive in games and graphics.


Which MoCap Animation Sits I have an UMA that I want to be in a sitting position basically forever. I assume I need an animation that will put him in an idle sitting position. I found the MoCap Huge Animation library for free in the Assets Store, but it is so big that I don't know which animation is sitting. Does anyone know of an idle sitting animation that I could use? Or specifically which number (ie 02 01) of the MoCap Huge Library which has one?


How to reset AnimatedSprite? In Godot v2, it seems that AnimatedSprite had a method set frame() see here. But in v3, this method does not seem to exist anymore. Only 3 methods are available see here bool is playing () void play (String anim quot quot , bool backwards false ) void stop () What is the way to reset an animation in Godot 3?


Designing an API for defining rigged game entities I am making a game framework for building constructing what I would imagine are called something like quot multi component rigged entities quot . This would be things like a stick figure drawing. Can't find a great animation to demonstrate, but something like this, where the head is a circle, the hands circles, the arms are poles, torso is one block, etc. (imagine there is no bending, only rigid shapes moving attached by joints). I need to design some kind of API for a user of the framework to use to describe such a rigged entity. As one example, I am looking at Vue.js and their API is basically like this, you have a template lt div id quot watch example quot gt lt p gt Ask a yes no question lt input v model quot question quot gt lt p gt lt p gt answer lt p gt lt div gt And a model, which has external internal properties, computed properties, and methods var watchExampleVM new Vue( el ' watch example', data question '', answer 'I cannot give you an answer until you ask a question!' , watch question function (newQuestion, oldQuestion) this.answer 'Waiting for you to stop typing...' this.debouncedGetAnswer() , created function () this.debouncedGetAnswer .debounce(this.getAnswer, 500) , methods getAnswer function () if (this.question.indexOf('?') 1) this.answer 'Questions usually contain a question mark. )' return this.answer 'Thinking...' var vm this axios.get('https yesno.wtf api') .then(function (response) vm.answer .capitalize(response.data.answer) ) .catch(function (error) vm.answer 'Error! Could not reach the API. ' error ) ) This is just one example of an API I am looking for. But what I'm looking for is some inspiration, perhaps from Unity or some other gaming framework engine, where it allows you to specify not quot view components quot but entire rigged entities like in this animation above. It seems to come down to a skeleton with bones and joints, and the bones are somehow attached to skins, but that's as far as my knowledge goes, and I'm not really sure what a DSL sort of thing would look like for defining a rigged entity. How can I design an API that handles this task?


How to motion capture animations? I'm not an animation artist and so I want to create some animations for testing. I want to use a camcorder to record me while I'm running and so I want to know if exists a software that grab the video and translate it in animation frames.


How do I use the morpher modifier in 3dsmax to morph into several targets simultaneously? I have a 3D Face from Facegen here including all necessary phenomes' positions. But these targets are separated into upper, lower teeth, sock and eyes. How do I combine them for the face to morph into each facial position at once?


How can I get my first person character in Unity to move to a ledge with an animation? I'm trying to get this to happen The character walks up to a large crate, the player presses a button, and an animation starts playing where the character climbs up on to the crate. (all in first person view). So far I tried this with normal "First Person Controller" Prefab in Unity. My code so far function OnTriggerStay(other Collider) if(other.tag "GrabZone") if(Input.GetKeyDown("e")) animation.Play("JumpToLedge") However when i use this on The FPC it will always play from the position the animation is created on. I also tried to create an empty game object, placing the FPC in there. Gives same effect. I also tried just animating the graphics of the FPC alone. This seems to work but since the Character Controller itself is not animated that stays onthe ground. So the whole FPC wont work anymore. Is there anyway i could let this animation play on the local position the player is on at that time? Or can you think of any other logical solution for a grab and climb?


How to interrupt movement where the model can lag behind I have a movement system for my characters where the model is allowed to lag behind the character's actual position. In a way it is like the model is being dragged on a string behind the actual position. This works well to smooth out the movement when the character is running around corners or changing direction, because the pathfinder will supply a list of waypoints that are otherwise followed in a straight line. The only problem I have is when the character is interrupted in his movement, if for instance he spots an enemy and wants to shoot at him. In this case the rendered model will often be a bit behind the actual position. What is currently happening is that the character changes state to shoot, but this is not immediately reflected in the model, because it is still moving (lerping) towards the actual position. As a result, when the model finally gets there, it will not have time to play the full shoot animation, so it appears like the character just lifts his weapon halfway to aim, then lowers it again. What is the best way to resolve this issue? It seems like there is no perfect solution...


How can I create a 2D "gooey" "sticky" separation effect? I want to create an effect similar to this animation where two shapes separate over time but are connected (for a time) by something gooey that stretches and eventually breaks. Like pizza cheese, but specifically in 2D. I'm using Swift and SpriteKit. I'm thinking this probably involves keyframes bezier path animations, but I'm not sure. How can I achieve this effect?


Milkshape3D Animation on Windows 7 64 bit when I run Milkshape 3D on my 64 bit Windows 7 machine, certain joints expand when I try to rotate them. For example, my model's leg has hip, knee, foot and toe joints. So to do a walking animation I would rotate the hip joint, then rotate the knee joint. Then as soon as I start rotating the foot, the foot joint moves away from the knee rather than just rotating around the axis. These images show what I'm talking about I've tried to run Milkshape in comaptibility mode and with the Mesa software OpenGL renderer, but it doesn't work. At the moment my workaround is to run Milkshape in a 32 bit Windows XP virtual machine. Does anyone know what causes it and how to solve it?


Exporting the frames in a Flash CS5.5 animation and possibly creating the spritesheet Some time ago, I asked a question here to know what would be the best way to create animations when making an Android game and I got great answers. I did what people told me there by exporting each frame from a Flash animation manually and creating the spritesheet also manually and it was very tedious. Now, I changed project and this one is going to contain a lot more animations and I feel like there has to be a better way to to export each frame individually and possibly create my spritesheets in an automated manner. My designer is using Flash CS5.5 and I was wondering if all of this was possible, as I can't find an option or code examples on how to save each frame individually. If this is not possible using Flash, please recommend me another program that can be used to create animations without having to create each frame on its own. I'd rather keep Flash as my designer knows how to use it and it's giving great results.


Sprite animation with "overlapping" animations? I'm trying to implement my own sprite animation system, and so far I've got it working quite nicely. I store each animation as a "take" which basically denotes the row of the animation in the sprite sheet, the starting frame and the number of frame. These takes are created during start up and played by calling play(takeID) on the animation. The player is split into four sprites head, torso, arms and legs, and different animations can be played on each of these separately from the other parts. Now, this works fine for situations where I only need a single animation (walking, idling, running, swinging a sword etc.), but I need a more complex animation system for situations where the player performs multiple things at the same time, for example walking while swinging a sword. I've tried to break down the requirements of the animation system by using the example above, and I've found these cases 1. Player swings the sword 1.1. Play swinging animation 1.2. When done, play idle animation 2. Player starts walking 2.1. Play walking animation until player stops 2.2. Play idle animation when player stops 3. Player walks and swings the sword 3.1. Play walking animation 3.2. Replace the animation of the hands by a swinging animation 3.3. When swinging animation is done, revert back to the "walking hands" animation 4. Player walks, initiates a swing and stops walking during the swing 4.1. Play walking animation 4.2. Replace the animation of the hands by a swinging animation 4.3. (Player stops walking during the swing) 4.4. Stop walking animation and play idle animation for all other body parts except the hands 4.5. When swinging animation is done, play idle animation for hands I've tried fiddling around with "overriding" animations where the animation with the higher priority (in this case, the "swinging" animation) would be shown instead of the lower priority animation (the walking animation) while updating still both simultaneously to maintain the correct rhythm of the original animation. However, I have trouble getting it to work properly. The "reversion to idle animation" is a rather challenging task if I have just the single walking animation, I can stop it and then play the idle animation (or rather, the "idle frame"), but when the sword swinging is added, it becomes more difficult to know when to swap to the idle animation. So, to conclude with my question has anyone faced a similar problem? How should I tackle this issue?


How should I go about handling nonuniformed sprite sheet with JSON data? This might be a lenghty question so bare with me. I'm developing a 2D game i Monogame framework and I'm stuck with it comes to handle large sprite sheets with different frame width, height and animation. I want to load a sprite sheet that has different animation. Like this one Taken from this question Some frames in this sprite sheet have different width and height, meaning that I can't use a uniform split with spritesheets width amount of columns because it will not work with all the frames. I have used a tool that gives me cordinates in JSON format like this " imagePath" "sprites.png", "SubTexture" " name" "spriteframe1.png", " x" "862", " y" "0", " width" "112", " height" "120" , " name" "spriteframe10.png", " x" "0", " y" "320", " width" "252", " height" "156" But here I have problem understanding how I should handle these different frames. How can I switch between animation frames and make sure that the animation loops with state of the object? E.G If the object in this case flies, I want to loop trough the wing animation but how should I handle it so that only the "Fly frames" are being looped? At the moment I have all the frames in a list where every element is a frame with its own x,y,width and height metadata.


What constraint (if any) limits crowd animation variety? I have recently noticed something in a large number of sports games relating to the animation of the crowd. Scenario Player holes the golf ball and the crowd all clap their hands. Whilst the faces and attire of the crowd members are different the animation is exactly the same. That is, the arm and hand movement of each member is identical. Similar scenarios exist in other sports games in football games the crowd often stand up and sit down together as well as doing things like "fist pump", wave, etc. in a perfectly synchronised manner. Question Why is there no (or very little) variation in the crowd animation? Is this a memory constraint? If so, what is the general architecure design of this functionality and why is it so constrained? Is it along the lines of "It is more efficient to animate a collection of objects than multiple individuals"? Or do game developers simply not see crowd variation as an important enough requirement? As technology and game "realism" advances so quickly, this is something that still strikes me as "wooden" and unrealistic.


Saving Skin weights Issue I have Skinned the character using rig simulator and now wanted to add Bendy controls.. How can I export the skin weights and apply on modified rig?


How does this animation work? This project "Locomotion Skills for Simulated Quadrupeds" creates an animation for the dog model in the program. However if you go into the project's files the dog's skeleton is made of individual obj files for each bone. How were the bones loaded into the program to make the complete animation? It's as if the position of the obj's were attached to... the vector I guess? Can anyone elaborate a little more? My reasoning for this is because I want to replicate it, create a model (to be animated) out of separate model files. I guess my question is how make one character out of several separate model files? Thanks


Data driven animations Say you are using C SDL for a 2D game project. It's often the case that people use a structure to represent a frame in an animation. The struct consists of an image and how much time the frame is supposed to be visible. Is this data sufficient to represent somewhat complex animation? Is it a good idea to separate animation management code and animation data? Can somebody provide a link to animations tutorials that store animations in a file and retrieve them when needed. I read this in a book (AI game programming wisdom) but would like to see a real implementation.


Wait till all CCActions have completed I am developing a simple cocos2d game in which I want to animate two CCSprites simultaneously, and for this purpose I simply set CCActions on respective CCSprite's as follows. first runAction CCMoveTo actionWithDuration 1 position secondPosition second runAction CCMoveTo actionWithDuration 1 position firstPosition Now I want to wait till the animations are complete, so I can perform the next step. How should I wait for these animations to finish? There are actually two method calls, the first one animates the objects via the code above and second call does the other animation. I need to delay the second method call until the animations in first are complete. (I would not like to use CCCallFunc blocks as I want to call the second method from the same caller as the first one.


FPS Android game that moves the gun as user swipes the screen I am Making a First Person shooter game for android. Gun moves in all directions I swipe left right up or down. But the speed is so slow. How can i increase it's Speed.Here is my code. void FixedUpdate () foreach (Touch t in Input.touches) if (t.phase TouchPhase.Began) initialTouch t else if (t.phase TouchPhase.Moved amp amp !hasSwiped) float deltaX initialTouch.position.x t.position.x float deltaY initialTouch.position.y t.position.y distance formula distance Mathf.Sqrt((deltaX deltaX) (deltaY deltaY)) bool swipeSideways Mathf.Abs (deltaX) gt Mathf.Abs (deltaY) if (distance gt 100f) if (swipeSideways amp amp deltaX gt 0) this.transform.Rotate (new Vector3 (0, 30f, 0), rotationSpeed Time.deltaTime) else if (swipeSideways amp amp deltaX lt 0) swipe right this.transform.Rotate (new Vector3 (0, 30f, 0), rotationSpeed Time.deltaTime) hasSwiped true else if (t.phase TouchPhase.Ended) initialTouch new Touch () hasSwiped false


Blending Two different animations I'm sure there are articles around on this but I'm not really sure what they are called. animation blending tends to give me the blend between two different complete animation such as walk and run. what I'm after is having a player with that has a walk jump animation and a firing gun animation. Is this still animation blending? Can anybody enlighten me to how this process could be achieved?


Is it possible to connect an external source machine to Live Link? I would like to be able to connect multiple external machines to Unreal Engine via Live Link in order to stream solved motion capture from one of the Vicon run time solvers retargeter (i.e. Pegasus). In one of the streams, it was mentioned that Vicon provides a client side plug in for Unreal that was used in the Siren demo. I decided to test Live Link's capabilities by connecting from a different machine to UE4 from Maya (I assume that the concept is the same regardless of the source program because at the end of the day we are sending solved animation data, right?). It turned out that Live Link in Unreal out of the box only detects the incoming data from the source machine that is on the same computer where Unreal is running. I am curious as to whether it is possible to modify Live Link or build a custom plug in using Live Link that would enable me to connect from an external machine to the engine over the network. The whole topic is very new to me, but I am tasked with providing a solution, so any information would be appreciated. Please correct me if I misunderstand the process. If you know where to look for more details regarding the problem, please tell me.


Why do I have to run my 2D game at 300 FPS for movement to be passably smooth? I'm working on a simple game with SFML, and the only way to make the game reasonably smooth is to allow it the highest framerate my machine can handle (that is, giving it no limit). 60 FPS in my game looks like 5 FPS in most games. I've made sure it wasn't any weird timing issue with sf Clock by making my delta variable constant, and I've made a simple moving square with the default SFML template to make sure it wasn't anything else in my code. Limiting framerate using window.setFramerateLimit(80), window.setVerticalSync(true), or by placing usleep(1000 15), a 15 millisecond pause ( 67 FPS, in theory) in the game loop, cause the terribly glitchy, asymmetric animation. I think the problem is my Mac. I hesitate to blame anything other than my code, but I just can't explain the problem otherwise. I'm running OS X Mavericks on a 15 inch MacBook Pro with a Retina display (2.4 GHz i7, Nvidia, 8GB RAM). Is it the Retina display, or some issue with the sleep() system calls? Any thoughts are welcome. Thanks!


Efficient sprite animation display methods? I'm making a game sprite, with animations for transitioning to different states, such as idle, sleeping, etc. I'm wondering what the most efficient way to play the animations is. As of now, I have a couple of ideas store all frames as separate PNG images, and display only the frames for the current state (e.g. play frames 1 5 for idle, 5 10 for transitioning, 10 15 for sleeping) make the animations into GIFs and play the one corresponding to the current state. merge them all into a spritesheet. Please let me know which would be the best approach, or if there's a better way to do things. I'm new to handling images and animation with code, so I'm not sure what the advantages and disadvantages are. Thanks! In case the information helps anyone, I'm planning to use Python for this (although I could also do Java or C , if there are good solutions in those languages), and the sprite image size isn't large, it's pixel art.


SDL sprite animation problem I'm currently drawing my character from a single file, and my sprite class handles it taking the file path as an argument. Now, I need to add a simple animation, cycling between two frames. The problem is that I have the other animation frame in another file, not in the same file as the first frame. How can I handle the animation without loading and unloading the two files and without merging the files into one?


How can I implement procedural humanoid generation like MakeHuman? Some applications allow you to generate a human mesh by simply adjusting parameters. The results are broad and convincing you can get from a thin asian girl to a muscular african man by just adjusting those. MakeHuman, for example, exposes the following UI What is the technique and what are the formulas used to implement that kind of procedural humanoid generation? Is there any published study resource with the required information?


How can I improve my Animation The first approaches in animation for my game relied mostly on sine and cosine functions with the time as parameter. Here is an example of a very basic jump I implemented. if(jumping) height sin(time) if(height lt 0) jumping false player landed player.position.z height if(keydown(SPACE) amp amp !jumping) jumping true time now() store the starting time So my player jumped in a perfect sine function. That seems quite natural, because he slows down when he reached the top position, and in the fall he speeds up again. But patching every animation out of sine and cosine is stretched to its limits soon. So can I improve my animation and provide a more abstract layer?


Trade offs of linking versus skinning geometry What are the trade offs between inherent in linking geometry to a node versus using skinned geometry? Specifically What capabilities do you gain lose from using each method? What are the performance impacts of doing one over the other? What are the specific situations where you would want to do one over the other? In addition, do the answers to these questions tend to be engine specific? If so, how much?


Is my skeletal animation algorith representation correct? I'm representing a rig (skeleton) as A root pivot point, with a position (Vector3) and a direction (Vector 3). A tree of bones, where each bone is a struct with a rotation (Quaternion) and a length (Float). I'm projecting the positions of the joints by Start with the root pivot point and the root bone, rotate it by bone.rotation and project it by bone.length across its new direction. The new pivot is a pair of position, direction. Repeat for each child bone. Is that correct?


2D Scaling a character with multiple RigidBody2Ds? So, this example is in the Godot Engine, but other engines porbably have this kind of problem, too I have a character with multiple RigidBody2Ds, that also has a bone skeleton for animation over them. Now, the problem is, that Godot's physics engine handles the transforms of the bodies, so they won't scale properly. If you scale the children (CollisionShape2Ds and Sprites) the positions will be off. Is anybody aware of a proper way to work around this? Being able to scale these kind of characters would be awesome. Thanks for all your answers. Greetings, Footurist


Smooth animation in Cocos2d for iOS I move a simple CCSprite around the screen of an iOS device using this code self schedule selector(update ) interval 0.0167 (void) update (ccTime) delta CGPoint currPos self.position currPos.x xVelocity currPos.y yVelocity self.position currPos This works however the animation is not smooth. How can I improve the smoothness of my animation? My scene is exceedingly simple (just has one full screen CCSprite with a background image and a relatively small CCSprite that moves slowly). I've logged the ccTime delta and it's not consistent (it's almost always greater than my specified interval of 0.0167... sometimes up to a factor of 4x). I've considered tailoring the motion in the update method to the delta time (larger delta larger movement etc). However given the simplicity of my scene it's seems there's a better way (and something basic that I'm probably missing).


How can I draw an animated vector field on a map? I want to render an animated vector field map similar to this wind speed visualization. How can I do this?


Character is out of location after animation montage in UE4 so I have my running and idle animation working fine on my character but once I do the attack animation thru an animation montage, my character slowly floats off the ground and as I attack many times it floats more and more and sometimes starts to lean and when I run and Idle it stays on air .. attached link to video https www.facebook.com groups 467991570685914 permalink 940206510131082


Ledge grab and climb in Unity3D I just started on a new project. In this project one of the main gameplay mechanics is that you can grab a ledge on certain points in a level and hang on to it. Now my question, since I've been wrestling with this for quite a while now. How could I actually implement this? I have tried it with animations, but it's just really ugly since the player will snap to a certain point where the animation starts.


Following a path in a smooth fashion I am currently making a 2d tower defense game with a static, predetermined lane that the enemies follow (i.e. towers cannot block the path and path finding is not the problem I am trying to solve). I am trying to figure how exactly to make units follow this lane in a smooth way. I have two rough ideas about how to do this, but I would love some input on which is likely to be easier to implement the more standard technique. Or of course if I there is some totally different way that I haven't considered I would love to learn about that as well. Waypoints My first idea was to define the path as a series of hard coded waypoints. Units would then use a basic "seek" steering algorithm (such as this one) to move to each waypoint along the path in succession. However, I have wondered if it might be hard to keep the units from deviating to much from the lane I want them to follow. I wonder if inability to turn sharply enough might cause them to sort of "glide" out off of the desired lane. I suppose I might be able to prevent that though by allowing for a relatively strong steering force to be applied? Bezier Curves The second solution I have considered is to define the path with a bezier curve and at each time step calculate the point along the curve with is (dt speed) away from the unit's current location. I suspect that this technique would make it much easier to precisely define the path that units will follow, but I don't know know how exactly to go about implementing this. Any suggestions? Also, I don't this will change anyone's answers, but units also must be able to travel at a constant speed along the path. Additionally, I am programming this game in python using the pyglet framework. If anything about the question is unclear please let me know. Edit Also for whatever its worth, I'm sort of trying to replicate the movement behavior of enemies in the Kingdom Rush.


Animation is delayed after few play attemps even though all transition times' are zero I am trying to play animation forward and backward when player press the same button again and again. I have a straight line and I want to convert it to 8 while moving it. I want to play animation backward or forward from the exact frame where I pressed the button again. When I pressed the button, animation starts playing and moving and If I pressed the button again in the middle of animation it is played backward from the exact frame. However, after a few try my animation starts playing with a delay or it stops playing completely. I am sending speedMultiplier parameter to make the speed 1 to play backward my animation. This is the video of the problem private Animator eightAnimator private bool isLine private bool isMoving private bool becomingEight private bool becomingLine private Vector3 nextPosition private Vector3 startPosition Start is called before the first frame update void Start() isMoving false isLine false becomingEight false becomingLine false eightAnimator GetComponent lt Animator gt () startPosition this.transform.position Update is called once per frame void Update() if(Input.GetKeyDown(KeyCode.M)) eightAnimator.SetBool("isMoving", true) if (isLine) isMoving true isLine false becomingEight true becomingLine false nextPosition new Vector3(this.transform.position.x 6, this.transform.position.y, this.transform.position.z) eightAnimator.SetFloat("speedMultiplier", 1f) else isMoving true isLine true becomingLine true becomingEight false eightAnimator.SetFloat("speedMultiplier", 1f) if(becomingEight) this.transform.position Vector3.MoveTowards(this.transform.position, nextPosition, Time.deltaTime 10) if (Vector3.Distance(nextPosition, this.transform.position) lt 0.01f) isMoving false becomingEight false eightAnimator.SetBool("isMoving", false) if(becomingLine) this.transform.position Vector3.MoveTowards(this.transform.position, startPosition, Time.deltaTime 10) if (Vector3.Distance(this.transform.position, startPosition) lt 0.01f) isMoving false isLine true becomingLine false eightAnimator.SetBool("isMoving", false) I am adding here unity package, video, screen shot and my simple code. So how can I play my animation when I pressed the button with the exact frame and exact time without delay This is the project unitypackage file


Where to find animated matrix transformations in an fbx file? Where can I find matrix transformation animation data in an fbx file? I have an fbx file with animations. I have successfully read the indices, matrix, and weight from it. How can I get the frame by frame changes in the matrix? Unfortunately, I haven't been able to find the answer in the Autodesk documentation.


Is there a way to squash stretch a sprite based on an angle? I have a ball that can move along any angle, and I want to squash and stretch it based on this angle. To be clear, if you dropped the ball down at a 90 angle, the squash would be all along the y, and the stretch on the x. This wouldn't work however for a 0 degree angle, where the squash is on the x, and the stretch on the right. Is there a way to generalise this into an equation?


How to reset AnimatedSprite? In Godot v2, it seems that AnimatedSprite had a method set frame() see here. But in v3, this method does not seem to exist anymore. Only 3 methods are available see here bool is playing () void play (String anim quot quot , bool backwards false ) void stop () What is the way to reset an animation in Godot 3?


Why does my sprite shifts position on specific animationframe? I have created a spritesheet to create animation. Everything is working fine untill I come to a specific frame in one animation. I have currently 3 animations loops Idle Animation Moving Animation Shooting Animation Nr 1,2 is working fine and behave like they should but when I am shooting my sprite shifts a little to the left. And I don't why it does. Here is a gif for the animations Here is the spritesheet I am using for the animations And here is the code I am using for looping and shifting different animations public void DrawSpriteSheetFrame(CustomTexture2D ct, Vector2 position, StateOfObject soo, GameTime gt, SpriteFont sf) if (! currentstate.Equals(soo)) currentframe 0 currentstate soo List lt SpriteFrameInfo gt currentLoopsheet ct.SubTexture.FindAll(x gt x.name.Contains(soo.ToString())) timeSinceLastFrame gt.ElapsedGameTime.Milliseconds if ( timeSinceLastFrame gt frameUpdateSpeed) timeSinceLastFrame frameUpdateSpeed if ( currentframe lt currentLoopsheet.Count 1) currentframe else currentframe 0 var t currentLoopsheet.Where(x gt x.name.Contains( currentframe.ToString())).FirstOrDefault() Vector2 origin new Vector2(t.width, t.height) var rec new Rectangle(0,0, 400,200) spriteBatch.Begin() spriteBatch.DrawString(sf, "Currentsheet " t.name, new Vector2(100), Color.White) spriteBatch.DrawString(sf, "Position X " position.X, new Vector2(100,150), Color.White) spriteBatch.DrawString(sf, "Position Y " position.Y, new Vector2(100,200), Color.White) spriteBatch.DrawString(sf, "SheetCord X " t.x, new Vector2(100, 250), Color.White) spriteBatch.DrawString(sf, "SheetCord Y " t.y, new Vector2(100, 300), Color.White) spriteBatch.Draw(ct.Texture, position, new Rectangle(new Point(t.x, t.y), new Point(t.width, t.height)), Color.White, 0, origin, 1, SpriteEffects.None, 1) DrawBorder(new Rectangle(new Point(t.x, t.y), new Point(t.width, t.height)), 1, Color.Black) spriteBatch.Draw(ct.Texture, position, new Rectangle(new Point(t.x, t.y), new Point(t.width, t.height)), Color.White, 0, Vector2.Zero, 1, SpriteEffects.None, 1) spriteBatch.Draw(ct.Texture, position, rec, Color.White, 0, Vector2.Zero, 1, SpriteEffects.None, 1) spriteBatch.End()


How do I make a flickering engine exhaust animation using only bone animation? I'm trying to replicate the flickering engine exhaust animation in this SketchFab model. SketchFab doesn't support particle systems, so the animation must be a simple bone animation. Can someone help me understand how to achieve such an effect? My best guess is animated opacity, but I don t know how to replicate it. My final goal is to use it in a Unity 5 mobile game.


Can CCAnimations be paused? I am new to cocos2d. I am using CCAnimation. It's working fine, except I want to pause the animation occasionally. How do I do this? Here's what I'm doing so far mySprite runAction CCRepeatForever actionWithAction CCAnimate actionWithAnimation walkAnim


Suitable interpolation for animating explosions Is there a standard interpolation function for animating explosions? Like there is with smoothstep or smootherstep for walking animations or cars going from point A to B. I'm assuming the explosion needs to grow very fast at the beginning and then slow down how much in relation to the default linear interpolation, I don't know. I've tried inverse smoothstep and inverse squared from this article Interpolation Tricks, but none quite cuts it, maybe I'm applying them wrong.


How to make my model's top section rotate without rotating the entire model? I'm trying to learn a bit of Maya modeling so that I can be self sufficient when it comes to creating super basic assets for my game development. I'm trying to understand skeletal rigging and how it modifies the model geometry itself. I've got the most basic model a cube with proportions that make it into a 3D rectangle. I've rigged it with a very simplistic skeleton. My goal is to learn how all of this works, and create a character that has motion similar to maybe the magic carpet from Aladdin it's a rectangle but the edges somewhat move like it has arms and legs. When I rotate some joints, it distorts the entire model. I added a bit more geometry thinking that it'd allow the top section of my model to rotate a bit more without having to deform the entire model, but it still just seems to do the same thing. How can I make the top section of my model be capable of moving forward and backward in such a way that it does not cause the entire model to move forward? Here are some screenshots to help explain and show my situation ... This is my model and skeleton (I told you it was super basic, lol) ... And here is what happens when I rotate around the neck joint ... And here is sort of what I was hoping to achieve ...


How to convert fbx with animations to dae I am making an ARKit app, and I need to implement animations. Our 3D artist has provided these files as fbx with animations. All resources I find online about animated models in ARKit talk about dae (Collada) files with animation. Is there a way to convert an fbx file with animations to a dae file containing the animations? I tried asking our artist to export a DAE file, but that didn't appear to work as he has no experience with DAE files. The animation didn't seem to play. I have also tried an online converter (http www.greentoken.de onlineconv ), but that failed to perform the conversion.


Number of iterations to real time I have an animation of traffic. I have 20 cars in road network, each car have a starting node and end node. Each car know how much distance does it need to travel in order to reach the end node. I move cars each 20 ms for 10 px. To move all cars from their start node to end node I need 60 iterations. That is 60 20ms 1200ms. Now I want to convert this time, or use data that I have, to a real time where car move 50km h. How can I do that? Any idea?


How can I get my first person character in Unity to move to a ledge with an animation? I'm trying to get this to happen The character walks up to a large crate, the player presses a button, and an animation starts playing where the character climbs up on to the crate. (all in first person view). So far I tried this with normal "First Person Controller" Prefab in Unity. My code so far function OnTriggerStay(other Collider) if(other.tag "GrabZone") if(Input.GetKeyDown("e")) animation.Play("JumpToLedge") However when i use this on The FPC it will always play from the position the animation is created on. I also tried to create an empty game object, placing the FPC in there. Gives same effect. I also tried just animating the graphics of the FPC alone. This seems to work but since the Character Controller itself is not animated that stays onthe ground. So the whole FPC wont work anymore. Is there anyway i could let this animation play on the local position the player is on at that time? Or can you think of any other logical solution for a grab and climb?


Managing animations for object state transitions I'm looking for an optimized way to handle simple state transitions on my game objects. By "simple" I mean not more than 1 2 actions per object, and most algorithms are linear. For example, I have an UI element that implements a switch (like a light switch) and it has two states "up" (lights turned on) and "down" (lights turned off). Let's say I want to make it so that I can switch the switch from one state to another, and update its presentation in a smooth way using linear interpolation (move the foreground sprite up or down). The question is if I should always check if the object should update its state (every frame), or should I add remove this object from the update loop on demand, or is there any other (better) way of handling this situation? Currently I have it implemented the following way my object has a boolean variable called animated and in my onframe loop I have the following code if (this.animated) calculate new positions for the sprite else do nothing And it would appear to me that this kind of code is not very well optimized. How to handle this kind of things better?


Creating a large amount of sprites and animations For my AP U.S. Government and Politics class, I am making a spinoff of Mortal Kombat. Because of time constraints, I'm using an open source version of the game and want to create new characters. I have about two weeks to do the project and can invest about 1 4 hours most days. I want it to look as nice as it can with the limited knowledge, skill, and time that I have. What programs or techniques would be best for a beginner with my time constraint?


Game engine animation management Usually in a game scene there might be tens of animations going on at the same time, each being in its own state. I wonder usually how is this managed in game engines? Do they just stack a variable indicating the state of the animation on entity? Or do they use a separate animation system to keep all states?


What is morph target animation? I've been using Adobe Flash and its keyframe based animation for some years. I recently about heard morph targets animation from Wikipedia. It seems that the morph target animation is also keyframe based. What are the differences between Flash's animation and morph target animation?


Rain World How to have intelligent movement animation? In the project RainWorld the characters seem to move "intelligently" as they move "unrestricted". They seem to know "how" to move their limbs and "what" needs to be done. Here for an example the lizard seems to know how to move his body after he got struck by a weapon. Also here it looks as if it is intelligently grasping the long ladder using the jet thinging to climb itself up. I had been looking into many sources to find out how such gets done but with no significant result. I need help to point myself to the right direction. Edit I have figured out from dev log that characters are just bunch of boxs connected bounded by an elastic bound "string". But the way the character moves still eludes me.


UE4 BlendSpace is not working as intended I am trying to set up a rifle aiming blendspace in UE4. I downloaded animations from Mixamo, added root bone and retargeted them to UE4. Then I set up the BS, but the legs of the character are behaving weirdly, they are twitching, going through each other. The animations work fine on their own, but behave that way in the BS, especially in the transition areas. Here is the video Video Here is my BS Here is how I am setting Speed and Direction variables used in the BS Can someone please help me with this? I am new to UE4. How do I fix this and get a smooth Animation Blend Space?


How do I play an animation using lib3ds? I am having trouble playing an animation of a .3ds object using lib3ds. I am able to load the .3ds model with lib3ds. But I can't find a way to play (for example) my 'walk' animation. Where can I find the animation data and how can I play the animation using lib3ds?


How can I generate isometric sprite sheets from 3D animations? I want to generate sprite sheets for an isometric projection of various 3d assets purchased from the Unity3D asset store. I'd preferably also render the normal maps. I am a programmer, but new to 3D modeling software (Blender, etc.) I found two tools for this SpriteForge and SpriteWorks, but neither supports enough formats to be worth their cost. There must be an efficient way of isometrically rendering various animations of a 3d assets in Blender mdash but I don't know how. How can I do this?


SDL sprite animation problem I'm currently drawing my character from a single file, and my sprite class handles it taking the file path as an argument. Now, I need to add a simple animation, cycling between two frames. The problem is that I have the other animation frame in another file, not in the same file as the first frame. How can I handle the animation without loading and unloading the two files and without merging the files into one?


Are there alternatives to Vertex Tweening? Now that I'm getting into animating 3D entities in my game, I was wondering what the best approach for this would be. I did some research and came across something called "Vertex Tweening". However, most of these articles (like this one http archive.gamedev.net archive reference articles article2017.html) are from 2003, if not older! In a DirectX 9 game which makes proper use of HLSL to do its rendering magic, is Vertex Tweening still the way to go these days (anno 2013), or are there other techniques I'm not aware of yet?


Doom style 2.5D Movement Animations I've started working on a demo for my 2.5D game. For a basic scene I figured I would just use the good old fashioned doom sprites textured to a double sided plane. Simple enough. But I've been scratching my head as to how to display the proper sprite animation relative to the player viewing the sprite...if that makes since. For example suppose I have three players in the scene Players A, B, and C as such Player C should see player A as Here's an example of what I think player A should look like from C's perspective While player B would see player A as follows My current idea is that for any given player, I will need to know the current direction of each other player, and where they are located moving to relativly. From this, I could calculate which sprite image is required. Is this correct? What improvements optimizations could be made? EDIT Total number of directions will be 8 as depicted below For each direction there are two sprites (to show walking movement, sprites for the right hand directions are mirrors of the left) EDIT 2 Got this working and have a simple javascript threejs example for anyone interested https github.com commanderZiltoid threejs 2.5d fps


What technique would I use to animate a 2D curling tentacle? I have played around in Cocos2D X and I think I understand the limitations of sprite based animation fairly well. I want to have a game with some characters curling and extending a tentacle which varies in length and amount of curl depending on the terrain. Maybe imagine a sloth swinging from a tree but with arms that stretch at times (Gumby character?). Is there a name for such a technique? Would this be a variant on Animating Bezier Curves as seen in Jason Davies's example or discussed in this blog on tweening control points? I'm a very experienced polyglot programmer but relatively naive in games and graphics.


Where to store polygons and polygon animation? I thought about making something with ApeOut graphics long before it came out and its release motivated me to try I'm having tons of fun but I stumbled upon a pickle. I can imagine storing polygons is a very common task in game development. I'm prototyping with pygame and currently store each polygon as a list of Vector2 coordinates vertices on a 10x10 field and keep these lists in a Python dict. This can't be a good practice. Is there an established format to store list of vertices (preferably supported by some free editor)? I was thinking about SVG but it works with curves and I only need straight edges. Or is SVG still the better option? What's a sensible way to store frames of an animation for such polygon (e.g. quot deer quot lowering its head when eating or moving its shoulders while walking, etc. legs will be driven by invert kinematics)? Right now I'm thinking about each animation being a list of frames where each frame is list of vertices but it'll become unmanageable if I don't separate animations to different files. What I have so far shapes I edit this in my head, was fun, slowly becomes a nightmare 'deer' (5,0), (4,1), (2,0), (3,1), (2,1), (1,0), (1,1), (4,2), (3,3), (4,5), (3,7), (3,8), (5,10), (7,8), (7,7), (6,5), (7,3), (6,2), (9,1), (9,0), (8,1), (7,1), (8,0), (6,1) , def loadShape(name, size) resolution 10 10x10 verts shapes.get(name) scaled tuple((point 0 resolution size, point 1 resolution size)) for point in verts surface pygame.Surface((size, size), pygame.SRCALPHA) pygame.draw.polygon(surface, colors.get(name), scaled) return surface


Sprite animation with "overlapping" animations? I'm trying to implement my own sprite animation system, and so far I've got it working quite nicely. I store each animation as a "take" which basically denotes the row of the animation in the sprite sheet, the starting frame and the number of frame. These takes are created during start up and played by calling play(takeID) on the animation. The player is split into four sprites head, torso, arms and legs, and different animations can be played on each of these separately from the other parts. Now, this works fine for situations where I only need a single animation (walking, idling, running, swinging a sword etc.), but I need a more complex animation system for situations where the player performs multiple things at the same time, for example walking while swinging a sword. I've tried to break down the requirements of the animation system by using the example above, and I've found these cases 1. Player swings the sword 1.1. Play swinging animation 1.2. When done, play idle animation 2. Player starts walking 2.1. Play walking animation until player stops 2.2. Play idle animation when player stops 3. Player walks and swings the sword 3.1. Play walking animation 3.2. Replace the animation of the hands by a swinging animation 3.3. When swinging animation is done, revert back to the "walking hands" animation 4. Player walks, initiates a swing and stops walking during the swing 4.1. Play walking animation 4.2. Replace the animation of the hands by a swinging animation 4.3. (Player stops walking during the swing) 4.4. Stop walking animation and play idle animation for all other body parts except the hands 4.5. When swinging animation is done, play idle animation for hands I've tried fiddling around with "overriding" animations where the animation with the higher priority (in this case, the "swinging" animation) would be shown instead of the lower priority animation (the walking animation) while updating still both simultaneously to maintain the correct rhythm of the original animation. However, I have trouble getting it to work properly. The "reversion to idle animation" is a rather challenging task if I have just the single walking animation, I can stop it and then play the idle animation (or rather, the "idle frame"), but when the sword swinging is added, it becomes more difficult to know when to swap to the idle animation. So, to conclude with my question has anyone faced a similar problem? How should I tackle this issue?


Animator on a WorldSpace Canvas Ok, so I have my world space canvas attached to the player object. In my script I have a reference like this GameObject myWorldCanvas Awake() myWorldCanvas transform.FindChild("nameOfObject").gameObject Then when the right conditions are met I simply activate the object like this myWorldCanvas.SeActive(true) This worked perfectly until I added a animator to the object. If I manually enable disable the object in the scene the animation works perfectly(it just changes the scale to give it a pop effect), but when the object is activated by my script the animation still plays and changes the scale values but nothing is rendered. In play mode if I manually enable disable the animation works. Any ideas ? If you need more info or screens let me know. Edit the canvas has some buttons as children and when I mouse over something seems to be refreshed and the images show up on screen. Edit Further test have show that manually disabling and enabling the Canvas component also shows the images, but If the canvas and game object are enabled from a script nothing shows up on the screen. Edit I solved the problem by disabling the canvas component on the first key of the animation and then enabling it on the second one where the Y scale is set to 0. This seems more like a hack and I dont like it. Does anyone have a idea why this is happening ?


Running one action on multiple sprites simultaneously I have created a spiraling animation for a football. I want to be able to run it on 2 sprites simultaneously. This is what I have done CCAnimation footballAnim CCAnimation animationWithFrame "Football" frameCount 60 delay 0.005f spiral CCAnimate actionWithAnimation footballAnim CCRepeatForever repeat CCRepeatForever actionWithAction spiral Sprite1 runAction repeat Sprite2 runAction repeat However, the action is only run on the first sprite. What am I doing wrong?


How to handle sprite speed when objects move using Box2d? I have a basic platformer using Box2d that works great. However, I now want to stop using my default square, and implement some running and jumping animations. How can I ensure that When running, the speed of the running sprite is correct with the current player speed, as to prevent the sprite from 'moonwalking'. When jumping, play the correct frames at the right moments? I imagine I need to check the vertical velocity and if this is zero again while jumping I'm at the highest point, but how do I track where to initiate the landing animation?