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 rotate character when pressing button?

how to rotate character in "free mode" when pressing certain button?

Product Version: UE 4.9
Tags:
more ▼

asked Oct 07 '15 at 08:34 AM in Using UE4

avatar image

zaikoni
1 2 3 4

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

3 answers: sort voted first

Based on your comments: What you want to do is controlling the camera instead of the character rotation while pressing a special key.

So you need to combine what I said with the DANjustYEAH's blueprint-screenshot and the fact that you can enable/disable the camera's ability to follow the controller rotation (which should be on a spring arm). There is an AnswerHub Question about this camera property here.

I'm not gonna post a full solution here, but you need something like this:

  • Setup the character as DANjustYEAH said

  • when the button is pressed, you enable/disable the 'Use controller view rotation' (disabled means it is locked on the character, enabled means the camera is free to move) on the camera.

  • While free camera mode is enabled, do not call the "Add Movement Input", so the character itself does not rotate.

more ▼

answered Oct 08 '15 at 09:05 AM

avatar image

Enlo
859 23 9 40

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

Your question is either too easy or not clear enough. It's so basic, that you can find it in any Example Project.

Create a FPS Example Project and look at FirstPersonCharacter:

  • Add an Axis Input for your key, call it something like "Move Right"

  • In your character BP, add an Input Move Right node and plug it into an "Add Movement Input"

  • As Input for World Direction, you use "Get Actor Right Vector"

more ▼

answered Oct 07 '15 at 09:35 AM

avatar image

Enlo
859 23 9 40

avatar image zaikoni Oct 07 '15 at 11:00 AM

No I mean like how assign rotation in a button for exaomple alt button and the character camera will only to be able to rotate when pressing the button?

avatar image DANjustYEAH Oct 07 '15 at 11:56 AM

From what I understand, you only want the action to work when a key is pressed, right?

So In this case the Gamepad button will only work (output true) if Left Alt is currently pressed down.

alt text

avatar image zaikoni Oct 07 '15 at 12:44 PM

wow thx for help! :) Testing this method right now :)

avatar image zaikoni Oct 07 '15 at 02:04 PM

I mean like this https://gyazo.com/7d0fbe89c18aa5e3ea9248db68751835 when button is pressed and when un-press the button it uses rotation pitch,controller rotation yaw and controller rotation roll.

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

You may want to check out the info in this thread, in particular the axis mappings.

This will make the input action happen for every frame.

After that it is just a case of using a AddActorWorldRotation node to move the camera and a Make Rotator node to create your rotation values.

more ▼

answered Oct 07 '15 at 03:23 PM

avatar image

DANjustYEAH
11 2 3 9

(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