Skip to content

Instantly share code, notes, and snippets.

@Razzlegames
Last active August 29, 2015 14:17
Show Gist options
  • Save Razzlegames/5c29d7ea9d97da9c9cc4 to your computer and use it in GitHub Desktop.
Save Razzlegames/5c29d7ea9d97da9c9cc4 to your computer and use it in GitHub Desktop.
func newSanta():
var santa = res.instance()
santa_count += 1
var name = "santa"+str(santa_count)
santa.set_name(name)
add_child(santa)
list_of_stuff.push_back(name)
print("Object owner is: "+ str(santa.get_owner()) + \
"This node's owner is: "+ str(get_owner()))
santa.set_owner(self)
print("Object owner is: "+ str(santa.get_owner()) + \
"This node's owner is: "+ str(get_owner()))
pass
# Output was:
# Object owner is: [Object:null]This node's owner is: [Object:null]
# Object owner is: [Spatial:561]This node's owner is: [Object:null]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment