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"

How to lock rotation of camera or pause game in c++

Hi

Sorry if this question has an obvious answer, I am still new to c++ and UE4 programming.

I get rotation through this code in my player controller:

InputComponent->BindAxis("Turn", this, &AGAME_Character::AddControllerYawInput); InputComponent->BindAxis("LookUp", this, &AGAME_Character::AddControllerPitchInput);

How can I lock the rotation of the camera when I have opened my c++ based inventory widget?

Or is it possible to pause the game and still have UI functionality? (And then unpause by pressing the inventory button on the keyboard again)

I have locked movement with a bool in the movement code. The camera movement is in Pawn.cpp but, is there a way to lock rotation without editing engine code inside of c++, so that I can update the engine version and use the code in other projects easily?

The player controller code is based upon: https://wiki.unrealengine.com/First_Person_Shooter_C%2B%2B_Tutorial

Product Version: UE 4.12
Tags:
more ▼

asked Jun 11 '16 at 03:10 PM in C++ Programming

avatar image

GamZ
35 2 2 7

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

1 answer: sort voted first

Make plugin with Pawn base class with overrided function of what you want to change and use that pawn class to make your pawns. Or/and override ACharacter too if you need to modify that class too

more ▼

answered Jun 12 '16 at 01:52 AM

avatar image

Shadowriver
36.6k 932 169 1111

avatar image GamZ Jun 12 '16 at 10:06 AM

Thank you, hadn't considered overriding it. I was able to do this inside of my player controller code

(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