Multiple animated sprites with the same animation

radubolovanradubolovan Posts: 7Member
edited December 1969 in 2D
Hello,<br /><br />In my Scene I added a node and 2 children:<br />- Sprite<br />- AnimationPlayer (and I added 1 animation)<br /><br />Sprite object has also a script attached:<br />
extends Sprite<br /><br />func _ready():<br />	get_parent().get_node(&quot;AnimationPlayer&quot;).play(&quot;rotate&quot;)<br />	var anim = get_parent().get_node(&quot;AnimationPlayer&quot;).get_animation(&quot;rotate&quot;)<br />	anim.set_loop(true)<br />
<br /><br />And after that I duplicated (Ctrl+d) the Sprite and move it to other location in 2D space of the Scene, but this one is static.<br />Is this a bug? Shouldn't the second sprite use the "rotate" animation as well since it uses the same script and it is duplicated from the animated one?

Comments

  • gtkamposgtkampos Posts: 9Member
    Make it a Scene and save. Then, instance this scene and you can duplicate. simple..
  • radubolovanradubolovan Posts: 7Member
    on 1464713082:
    <br />Make it a Scene and save. Then, instance this scene and you can duplicate. simple..<br />
    <br /><br />Yas, it works this way. Thanks a lot!
Sign In or Register to comment.