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"

How to rotate Pitch of camera to match the direction the player is facing when flying upwards?

I have a third person, flying character who moves forward, back, left, right and vertically up and down. The character moves up or down by pressing the left or right mouse button. When doing so, the Pitch of the character rotates to match the direction of movement (tilts up when flying up, down when flying down). However, I am struggling to get the camera to follow this rotation, nothing I can find or think of seems to work. I would like the camera to face the direction the character is facing. So when he tilts upwards and flies upwards, I want the pitch of the camera to also match this tilt.

I am very new to blueprint and still learning so I would appreciate as much detail as possible when answering so I understand how to implement the advice. Thank you very much in advance. :)

I hope this makes sense please let me know of anything else needed to help explain and I will gladly add it. I have included an image of my movement script.

alt text

Product Version: UE 4.9
more ▼

asked Dec 03 '15 at 08:47 PM in Blueprint Scripting

avatar image

1 1 2 3

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

1 answer: sort voted first

Hello Aidenjl,

Would it be possible for you to apply the rotation to the entire actor instead of just the FlippyMesh? This should cause the Spring Arm that the Camera is attached to to rotate as well. If not, can you attempt attaching the Spring Arm to the FlippyMesh so that it should follow any rotation of its parent?

more ▼

answered Dec 04 '15 at 06:27 PM

avatar image aidenjl Dec 05 '15 at 02:03 PM

Thank you so much for your response. This has helped me get it very close to how I wanted it.

I managed to get the camera to rotate by attaching the Rotation to the Camera as a second target, as well as being attached to the FlippyMesh (For some reason it didnt work when attached to the SpringArm, only the Camera).

However, this obviously also causes the camera to rotate on MoveForward as well, but I only want it to happen on MoveUp (on Moveforward, the Mesh should rotate but not the Camera).

I have fiddled around with it a lot and can't quite figure out how to make the Camera only rotate on MoveUp.

In case you can also help with this, I have attached the current Blueprint. alt text alt text

revised_1.jpg (254.8 kB)
revised_2.jpg (271.8 kB)
avatar image Matthew J Dec 08 '15 at 05:30 PM

If the result needs to different for the two different functions, the easiest way to do this would be to copy/paste the logic and hook them up separately, making one catered to rotating both components while the other only rotates the Mesh. You could also do this with booleans but it would still require some editing of the logic due to the exact same SetRelativeLocation nodes being used for both events.

(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