Advertisement
nezvers

Godot change active script

Sep 16th, 2020
1,242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.24 KB | None | 0 0
  1. var current_code:String
  2. onready var instance:Node
  3.  
  4. func get_code()->void:
  5.     current_code = instance.get_script().source_code
  6.  
  7. func set_code()->void:
  8.     instance.get_script().source_code = current_code
  9.     instance.get_script.reload(true)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement