Skip to content

Instantly share code, notes, and snippets.

extends MeshInstance
export var lod_distance = 15
export(Array,Mesh) var meshes
func _notification(what):
if what == NOTIFICATION_VISIBILITY_CHANGED:
set_process(is_visible_in_tree())
func _process(delta):
@thimenesup
thimenesup / multimesh_collision.gd
Created April 26, 2019 14:28
Adds static collision to all the instances in a multi mesh node
extends MultiMeshInstance
export(Shape) var shape = null
var _shape_rid = null
var _bodies = []
#Done in _enter_tree() and not in _init() because its when the exported shape and world space is set
func _enter_tree():
_shape_rid = RID(shape)
onready var timer = Timer.new
var wait_time = 30 #The video duration
func _ready():
add_child(timer)
timer.set_wait_time(wait_time)
timer.connect("timeout",self,"video_ended")
timer.start()
func video_ended():
extends Node
func _ready():
var img = ImageTexture.new()
img.load("res://image.png")
var img_data = img.get_data()
var raw_data = img_data.get_data()
save(raw_data)
func save(content):