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.
Constant Lookat() function?
Re: Constant Lookat() function?
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:
('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.
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)
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.
-
- Posts: 65
- Joined: Fri Feb 06, 2015 3:51 pm
Re: Constant Lookat() function?
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?
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.
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.
-
- Posts: 65
- Joined: Fri Feb 06, 2015 3:51 pm
Re: Constant Lookat() function?
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.
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?
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?
Here's a link to the new LiveLookAt() that snaps to the target immediately if no duration is specified:
SequencerCommandLiveLookAt_2015-06-30.unitypackage
SequencerCommandLiveLookAt_2015-06-30.unitypackage