Camera init animations don't work in loaded collection proxy (SOLVED)

Hey there, Defold team!

Well, my loader enables a collection proxy, switches focus to it and on init camera position is set off screen and then flies to a screen center. But nothing happens until you move a mouse cursor, while print line in camera init function works fine.

Loader also has a camera, and both have some shadows. It looks like both shadows stack once mouse moved. I.e. it turns on loaded proxy camera only when mouse moved.

Here’s “proxy_loaded” process:

	msg.post ("/proxies#metaproxy", "init")
	msg.post ("/proxies#metaproxy", "enable")
	msg.post ("/proxies#metaproxy", "acquire_input_focus")

And cam init function:

	msg.post("camera#camera", "acquire_camera_focus")
	go.set_position (coordsMeta, "/cam")
	go.animate("/cam", "position", go.PLAYBACK_ONCE_FORWARD, vmath.vector3(0,0,0), go.EASING_OUTCIRC, 1, 0.5)
	print ("DONE!")

It prints DONE!, but the screen is empty and starts working only when you move the cursor.

Are you put your code in on_input function?

1 Like

No, but proxy on_input has some other means to control the camera. It slightly moves camera in direction opposite to cursor vector. And it works when mouse is moved.

SOLVED: Just figured out, that controller/loader should be a tiny script above all, and what I did was Assassin’s Creed style loader with cursors, cameras jumping around, animations and all that… And loader like that should be a separate collection.

Huuuuuge thanks to all the forum here)

2 Likes