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"

GTA 2 like character movement

I am making game with GTA 1 and 2 like movement (link below) and I can't invent how to script character rotation properly. I want to rotate itself left (when press A) and right (when press D). I would be really glad for any help :)

link: https://www.youtube.com/watch?v=YCc0jEm43A0

Product Version: UE 4.8
Tags:
more ▼

asked Jul 31 '15 at 01:05 PM in Blueprint Scripting

avatar image

Szpejn
6 3 8

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

2 answers: sort voted first

Ok I solved the problem with rotation lock. Now I want to make this rotation smooth and continuous during pressing an A button. Any idea? :)

more ▼

answered Jul 31 '15 at 02:21 PM

avatar image

Szpejn
6 3 8

avatar image Szpejn Jul 31 '15 at 02:31 PM
avatar image happyhorror Jul 31 '15 at 02:51 PM

glad to see you got needed result, don't forget mark question as answered, so anyone else later can have same question and may find solution faster

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

Hi,

it's probably no matter if you will make it 2D or 3D, in any case you will have object "player" (like 2D mesh, or 3D actor, really no matter). From this statement you simply can add key press events in you player BP with specific keys, just right click at event graph in your BP and type "keyboard events", you'll find many keys, but this is simple way, more flexible set key in project settings to make later easier key changing in game setting

so after you have key events and it's inside your character BP all you need is "AddActorLocalRotation" and you can rotate your character at pressing A and D :)

more ▼

answered Jul 31 '15 at 01:51 PM

avatar image

happyhorror
576 54 46 72

avatar image Szpejn Jul 31 '15 at 01:57 PM

How to get rid of this? It can't pass 90 degrees. When i press A it turns left and then starts to turning right.

Animation: http://gfycat.com/BothInsecureJapanesebeetle BP: http://scr.hu/0y9c/8ej8p

avatar image Szpejn Jul 31 '15 at 02:17 PM

Solved: I ticked "Use controller rotation Yaw" under Pawn section in Character details :)

(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