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. 

Trying to rotate an object as long as a key is held

I'm trying to rotate the object that a top down camera is attached to so that when one key is held down it rotates one way and when a different key is held it rotates the other way. I've managed to get the rotation to occur when the either of the keys are pressed but the rotation only occurs once instead of continuously and when the key is released the rotation is reset

Here's a video showing the issue

alt text

Edit: updated the blueprint picture

Product Version: UE 4.16
capture.png (295.1 kB)
more ▼

asked Mar 19 '17 at 12:48 AM in Blueprint Scripting

avatar image

1 1 3 4

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

3 answers: sort voted first

The GetActorRotation returns the rotation of the root component of the actor, however the SetActorRotation sets the rotation of the actor, not the root component. So I guess you are never changing the rotation of the root component, and adding to it every frame, so the new rotation value essentially stays the same. Try to set and get the rotation of the root component directly instead of the actor. (If this is the problem, then these nodes are have a serious naming problem)

more ▼

answered Mar 25 '17 at 10:04 PM

avatar image

1.2k 46 29 59

avatar image Interstice Mar 26 '17 at 11:17 PM

Following your advice I went to the Blueprint reference section of the documentation to find out what node would actually adjust the root component directly. This ended up being the SetActorRelativeRotation node. I tried this node and just about every other node that had something to do with rotation, but none of them fixed the issue

avatar image pulp_user Mar 27 '17 at 09:19 AM

You can manipulate the root component by using the GetRootComponent node of the actor and then using get/setWorldRotation.

avatar image Interstice Mar 27 '17 at 05:48 PM

I hadn't thought of that, but after trying it the problem still persists. I've added a link to a video showing the problem above

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

This one is actually rather simple.

For starters, you need to have your camera and object you are rotating part of a Pawn blueprint like so:

alt text

Than in the project settings create a new input for "Turn"

alt text

Finally add world rotation using the new "Turn" event that gets created when you make the inputs in the project settings:

alt text

If you haven't already, make a game mode with the Default Pawn Class set to your new pawn, and in the world settings change the GameMode Override to your new game mode.

pawn setup.png (623.2 kB)
setup inputs.png (129.0 kB)
more ▼

answered Apr 26 '17 at 08:37 AM

avatar image

723 20 25 108

avatar image Shadowfang TC Aug 16 '18 at 07:22 AM

Thank you. I've been looking for a solution to a similar issue for a few weeks.

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

that sequence node will never be executed like that because it does not have an entry from tick.

plug tick in sequence. then connect then 0 to first gate and then 1 to second gate

more ▼

answered Mar 23 '17 at 12:34 PM

avatar image

2.4k 72 41 107

avatar image Interstice Mar 24 '17 at 02:00 AM

I had disconnected the event tick from the sequence because I thought that it might have been preventing it from working properly. The original problem occurs either way

(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