x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

Camera Offset Problem Solving

Hi, I've been racking my head for hours now trying to come up with a solution to the following problem.

I have a 3D sidescroller fighting game, in which I want the camera to "follow" both of the characters by positioning itself at the midpoint between them. Additionally, it should be offset as to act as a purposeful camera.

However, as this is 3D game, the characters and camera are often rotated to accommodate the levels, so a universal vector offset cannot be used.

In order to achieve the desired effect and for functionality with no dependency on fixed rotations, the use of the rotation of the camera must be used to achieve the desired vector offset.

Thanks, Alfie alt text

Product Version: UE 4.20
Tags:
untitled.png (37.9 kB)
more ▼

asked Nov 01 '18 at 09:25 PM in Blueprint Scripting

avatar image

AlfieLC
44 7 7 12

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

The solution I came up with was to use the FindNearestPointsOnLineSegments node with the first segment being the first and last point of a spline component, and the second segment being the centre point between the characters.

This locked the position of the camera perfectly along the spline component which of course solved all the previous issues mentioned. alt text

solution.jpg (85.7 kB)
more ▼

answered Nov 02 '18 at 08:28 PM

avatar image

AlfieLC
44 7 7 12

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

I think there is a node to find the midpoint on a plane or line. You can define that plane or line using the two player pawns locations as the start and end positions. Then just have the camera turn to the LookAt Rotation with that point as the target. Also you can pull the camera back or change fov based on the distance between the players.

more ▼

answered Nov 02 '18 at 07:52 PM

avatar image

mightyenigma
3.8k 18 20 20

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question