Which view type to recreate camera from legend of zelda n64 + lock-on?

kentreva

Member
In loz n64, the camera has 3 main behaviors.
1) The camera will auto rotate in the direction player is moving. (there is noticeable drag) Click for demo.
2) Pressing the 'z' button, will align the camera to the character's forward direction. Click for demo.
3) When locked on to an enemy, the camera rotates to always face the enemy. Click for demo.

My initial approach
I was planning on using the 3rd person Combat view type + editting the aim assist script because a friend suggested it, but after playing with the demo, it it's hard to tell which View Type I should use because the mouse is always active, and it controls the camera.

I'm not very experienced coder so really appreciate what View Type mimics this behavior and if there is none, what is the best way to go about this?

The Aim Assist script in the demo only seems to aim when the cursor goes over the Enemy, but I would like to trigger it when an Enemy is in the camera view if that makes sense. How would I go about doing this?

Thank you so much for the help!
 
For 3, I've also noticed the Aim Assist for opsive only keeps the Enemy locked on to the center of the screen. See here
In loz, the camera lets the lock on target anywhere on the screen, not just center. See here
 
This will take a new View Type:


I would start with the Adventure View Type and then start to modify from there.

For Aim Assist currently does only aim in the cursor location so this will also take some modification to that script.
 
Ok we looked into the docs and found out that Requirement 2 and 3 can be abilities.

We just want a view type that mimics Requirement 1: camera has to rotate in the direction character is moving.
The RPG view type seems to do this. Is there a reason why you suggested Adventure view type instead? Sorry I'm so confused which to pick. : (((
 
Let's say we already have the transform of the locked on object, and its position on the canvas (worldToScreen position)
How would I edit the Aim Assist to use this? We just need the camera to aim at it in 3rd person.
 
The Adventure View Type is a lot less specific so it's good to build on. But you can definitely take features from other View Types when creating your own.

For Aim Assist you should override the TargetRotation to return the new quaternion of your delta rotation to the target. I'll make sure this method is virtual in the next update so you don't need to keep changing it.
 
Hi Justin. I used the SetTarget method to set the target via script, but the camera position is not desired as it always has the targetted object be at the very center of the screen, as shown here:
. And even worse if we want our character to stay in the center, it covers the targetted object:
1651638985890.png

What should happen is the character and target should both be visible in the camera. The target should not be locked to the center of the screen.
Character movement must also be moving around the targeted enemy. The desired behavior is provided here:
1651639035341.png

Looking at other forum posts (attached at bottom), it seems like this behavior is requested often but discussions don't provide concrete solutions, but it will require the view type to be editted, and it seems to be left to the dev to figure out.

However, I feel like this would help many gamedevs if this was built in to the asset, as its a number 1 priority feature in most 3rd person games like zelda, dark souls, kingdom hearts, dmc, etc. (Like no joke. In my game requirements doc there's a whole section just for lock on system XD. Thought the aim assist would provide the functionality but sadly not, which is fine for now, the rest of the asset is amazing) But if this lock system was a thing, it would be convenient as heck for ppl who also bought the inventory pro asset which seems to be built exactly for those type of games.

I do agree that the logic that handles deciding what to lock on to and the lock on cursor rendering, should be up to the game dev. But since this is a camera/character controller asset, it'd be cool if the part that handles the camera positioning/rotation was handled by the asset.

Please let me know if this will be an upcoming feature, and expected release date. If not or not anytime soon, then please email me directly; willing to commission this
 
Last edited:
Top