Quantcast
Channel: Questions in topic: "dynamically"
Viewing all articles
Browse latest Browse all 152

Add a child GameObject to a tk2d sprite dynamically

$
0
0
Hello everyone, I have a 2D character with "Idle" animation, (3-4 frames) and I am using tk2d. When I hit my character, I need to add a scarf/injury (png) to the hit point. I am able to Instantiate at hit point. I am able to make it child to the enemey character. But the problem is that the sprite moves, and its not the transform.position that changes, but the textures.. and as a result, the scarf stays at its place, where the character moves. I can't figure out a method to stick my png to the hit point.. Maybe there's a way to change the texture atlas dynamically? Sure I can have tons of millions of textures.. with a scarf at each position .. bla bla.. sure not thinking of that dumb way.. As I have many characters/levels.. Hope to get some hints.. thanks

Viewing all articles
Browse latest Browse all 152

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>