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. 

Force Camera Rotation

Hi,

I try to make a mini game where the player control something that can fly and roll when needed. For the Flying mode, I used the mechanic of the flying exemple in UE4. For the rolling mode, I used some of the rolling exemple. Now, when I press "spacebar", movement affect the pawn differently, the physic is actived if necessary ect.. all of there thing work fine. I just have 1 problem: the camera!

In flying mode, the camera follow the pawn, that more simple to control it properly. In rolling mode the pawn go forward (With torque) in the camera axis, all work fine and the camera don't have to follow the pawn if it did, the camera rotate in all direction and it's unplayable. To do that, I have set Inherit Pitch, Yaw and Roll to false for the SpringArm of the camera in rolling mode.

When I'm in flying mode, and if I flying around, the Z axis of the camera change, normal, for this exemple, to 90° from the initial Z axis. But when I change to rolling mode, the camera is like to re-initilaised and 0°... and when I go back to the flying mode, the camera is well placed, behind the pawn at 90° of the initial Z axis.

There is a way to force the camera, in this rolling mode, to be in the same axis that the flying mode when changing mode?

I have already tried "SetWorldRotation" with the rotation of the camera before changing mode, same with "SetActorRelativeRotation" and "AddActorLocalRotation" or "Set Absolute Rotation" to true for the SrpingArm, with no luck :/

Thank you for your help!

Product Version: UE 4.16
Tags:
more ▼

asked Mar 17 '18 at 04:00 AM in Blueprint Scripting

avatar image

nynjardin
1 1 3

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

1 answer: sort voted first

Ok, I found a solution by myself!

There is my solution, if needed by someone

Up is for Flying mode and bottom is for rolling mode

alt text

more ▼

answered Mar 18 '18 at 06:11 AM

avatar image

nynjardin
1 1 3

(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