Advertisement
otorp2

instantiate pass parameters

Jun 2nd, 2016
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. There probably are better ways to do this but here is what I did:
  2.  
  3. Create your own init() function in mySprite.gd and call it after instancing the scene.
  4.  
  5. var mySprite = preload("res://mySprite.scn").instance()
  6. mySprite.init(a, b)
  7. getparent().add_child(mySprite)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement