Page 1 of 1

Constant Lookat() function?

Posted: Mon Jun 29, 2015 1:17 am
by SuperSparkplug
Hi there,

I was wondering, is there a way to make the LookAt() sequence command constant to follow something? As is, it only locks on to an object at a certain moment and fixes itself in place. I want for a character to come into a scene and have the player camera follow the character as he walks towards the player.

Re: Constant Lookat() function?

Posted: Mon Jun 29, 2015 9:21 am
by Tony Li
Hi,

Can you use LiveCamera()?

For example, say the NPC is named Fred. This command will make the camera move in a medium shot following Fred over 3 seconds:

Code: Select all

LiveCamera(Medium, Fred, 3)
('Medium' is a camera angle defined in the default camera angles prefab.)

If you don't want the camera to move, and instead only want it to rotate to look at the NPC, then for an immediate solution you'll have to write a short custom sequencer command because the LookAt() command doesn't follow a moving target. If you need this, let me know; I can post the command script here later today. If you don't need it immediately, I'll look into making this an option in the built-in LookAt() command.

Re: Constant Lookat() function?

Posted: Mon Jun 29, 2015 6:02 pm
by SuperSparkplug
Yes, I only need the camera to rotate in place to follow the position of the NPC. I kinda do need it immediately, so, if it's not too much trouble, could you give me the command?

Re: Constant Lookat() function?

Posted: Mon Jun 29, 2015 9:57 pm
by Tony Li
Here you go: (NEW PACKAGE) SequencerCommandLiveLookAt_2015-06-30.unitypackage

This package contains a new sequencer command: LiveLookAt(target, [subject], [duration], [allAxes])

Unlike the built-in LookAt() sequencer command, it immediately snaps to look at the target and then tracks the target for the specified duration.

Only the target is required. The other parameters are optional.

Re: Constant Lookat() function?

Posted: Tue Jun 30, 2015 2:41 am
by SuperSparkplug
Ah interesting. It works! Thanks a lot!

Also worth noting, it seems the duration is also necessary, or it will not update where the camera is pointing when the target moves. Just letting you know.

Re: Constant Lookat() function?

Posted: Tue Jun 30, 2015 8:36 am
by Tony Li
Thanks for noting that. I'll change it in the next version so it immediately looks at the target even if there's no duration.

Re: Constant Lookat() function?

Posted: Tue Jun 30, 2015 10:10 pm
by Tony Li
Here's a link to the new LiveLookAt() that snaps to the target immediately if no duration is specified:

SequencerCommandLiveLookAt_2015-06-30.unitypackage