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"

AnswerHub Maintenance

Background maintenance is scheduled to occur between 9 - 11am EDT on Tuesday, May 21. Site operation may be slower than normal during this time and a brief interruption in operation may be observed

How to make side scrolling character do a full turn when changing direction?

Hi all! =)

I've started with the Side Scrolling Template. It do almost fine, but there is one problem. When I'm moving right, then I press the left button, the character starts to turn. If I release the left button while turning the character stops imediately, facing towards the camera. I need the caracter to do a full 180 degree turn even if I just tap the left button, always facing sideways.

Messing aroung I found a RotationRate, that makes it turns faster, but the problem still occurs. How can I achieve that??

(Can be either blueprints or c++)

Thanks in advance!!

Product Version: Not Selected
Tags:
more ▼

asked Jun 21 '14 at 02:46 PM in Blueprint Scripting

avatar image

Jandex
71 8 9 15

(comments are locked)
10|2000 characters needed characters left

5 answers: sort voted first

I just created a internal vector to be only left or right, and always keep lerping rotation until forward vector aligns with that vector.

more ▼

answered Oct 07 '14 at 01:44 PM

avatar image

Jandex
71 8 9 15

avatar image bpneal07 Aug 13 '15 at 03:33 PM

Hey Jandex how would you approach this in blueprints? I've been trying to figure out for a side scroller I'm trying to create. Thanks

(comments are locked)
10|2000 characters needed characters left

Hi man , if you want that the char once started the rotation dont stop if you unpress the key, you have to put this actions elsewhere.

you want start the flipping with Left or Right, so in the event Key , set a WishSide to 0, or 1. and then in the tick event , check all and rotate your char.

something like: i am currently facing my wish side?
so i put turning to 1 and slowly turn my rotation, tick by tick, toward my wish side. when i get the rotation , i set my currentside, and turning to 0 while the turning is active i still can choose another direction , i will ignore that my wish side and my current side match, because i still turning(1) , and probably i am half turned.

Booleans

WishSide = this is the boolean you change with the InputKeys

CurrentSide = this one keep your status, if you are currently watching Left 1 or Right 0

Turning == if this you are currently turning

thats a little messy , but the meaning part, its' you want execute the event rotation , freely from the button. so you have to call the rotation from another place. Example:the Tick event

more ▼

answered Sep 16 '15 at 03:08 PM

avatar image

Est_engine
1.2k 58 12 62

(comments are locked)
10|2000 characters needed characters left

Thanks to Est_engine's comments, I've found a solution to do a full 180 turn (and keep the character facing the camera when turning) which I've posted here. Thanks for your great input, Est_engine!

more ▼

answered Dec 12 '16 at 05:20 PM

avatar image

AJ_Graphix
272 15 20 29

(comments are locked)
10|2000 characters needed characters left

In Class defaults just find bool variable with name Use controller Rotation yaw. While is true then is Rotation of Character mesh reset to default value (e.g. -90), but when is false then rotation after input is stopped in position of current state and it doesnt reset it.

more ▼

answered Mar 29 '18 at 07:10 PM

avatar image

Hargreawe
1 1

(comments are locked)
10|2000 characters needed characters left

Here's the answer you're looking for:

https://answers.unrealengine.com/questions/280933/how-do-i-get-my-side-scroller-character-to-turn-ar.html

Basically uses the "Set World Rotation" node.

When movement input is > 0, sets character facing right.

When movement input is < 0, sets character facing left

more ▼

answered Jan 16 '19 at 08:42 PM

avatar image

Adam Kareem
16 3 2

(comments are locked)
10|2000 characters needed characters left
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