setCamera Question

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
Post Reply
User avatar
akroma222
Posts: 1029
Joined: Thu Oct 04, 2012 10:08 am

setCamera Question

Post by akroma222 »

Hi All,
just wondering about how setCamera works... (how to correctly reference other cameras too?)

Ive checked this thread .... ....and seen GameMode:setCamera(nil) will return the camera to the party view point... but no luck :cry:

Ive just added a Camera Component to a (light) Object
SpoilerShow

Code: Select all

{
			class = "Camera",
			name = "camera",
			--fov = 100,
			--nearClip = 0.1,
			--farClip = 100,
			onInit = function(self)
				GameMode.setCamera(self)
			end,
			--onUpdate = function(self)
				--print("cam update")
			--end,
		},
The onInit works fine, changed the camera... but cant change back??
User avatar
akroma222
Posts: 1029
Joined: Thu Oct 04, 2012 10:08 am

Re: setCamera Question

Post by akroma222 »

Also, do we NEED to do things in the update Hook?? (Ive checked how the main menu camera works... )
User avatar
Isaac
Posts: 3192
Joined: Fri Mar 02, 2012 10:02 pm

Re: setCamera Question

Post by Isaac »

A good thread on the subject: viewtopic.php?f=22&t=8494

[Actually... just a good single post :)]
User avatar
akroma222
Posts: 1029
Joined: Thu Oct 04, 2012 10:08 am

Re: setCamera Question

Post by akroma222 »

Ahhh Indeed it is!! I had not seen this thread before
Thankyou Isaac :D
Post Reply