top of page

Distance between components

It is easy to get the distance between actors, as there's a node for it, but between components within an actor, it requires a little more work.

This example lets us use the mouse scroll input to adjust the camera's SpringArm length relative using a min and max distance between the Camera component and the player's Capsule component. It assumes a TopDownCharacter.

The collapsed graph highlighted above is what serves as 'Get Distance Between Components'.

The Collapsed nodes : DistanceFromCapsuleToCamera

The zoom this creates, by the way, is kind of raw. The step is very incremental.

Pros: When you stop scrolling, it stops immediately, so you can set your preferred distance.

Cons: You have to do quite a bit of scrolling to zoom all the way in and out.

Instead, you could have MouseWheel interaction play/reverse a nice Timeline driven camera move, and allow only opposite mousewheel input while that's rolling, so you need just a flick of the hand to control it.

To let users choose whether to enable this scrolling is always a good option. Setting 'CameraMinForwardVector' to 2001 (more than the default distance of 2000) would disable any inward zoom, so you could just flip that value between 400 or 2001 when the user set their preference.

Featured Posts
Recent Posts
Search By Tags
Follow Us
  • Facebook Basic Square
  • Twitter Basic Square
  • Google+ Basic Square
bottom of page