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"

I need help with making my sprite to switch to idle animation when standing still.

alt text Here is what im working with

Product Version: UE 4.14
Tags:
make it idle.png (76.8 kB)
more ▼

asked Nov 30 '16 at 08:44 PM in Blueprint Scripting

avatar image

Chippred
13 3 5 6

avatar image Marinara.Sauce Nov 30 '16 at 09:00 PM

Are you using an animation blueprint?

avatar image Chippred Nov 30 '16 at 09:15 PM

no, flipbook alt text

blopasda.png (61.4 kB)
(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first
more ▼

answered Mar 05 '17 at 08:45 PM

avatar image

Chippred
13 3 5 6

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

Hello, a simple solution could be to put these nodes inside the event tick instead of the event BeginPlay. That way, when your character will not be moving, it will automatically call the idle animation. However, doing so will cancel any other action (e.g. punching while not moving).

Alan Noon did a great youtube tutorial on how to implement 2D sidescrollers. You could check it here: https://www.youtube.com/watch?v=cCl1DHhIYeY

Hope it helps ;)

more ▼

answered Nov 30 '16 at 09:06 PM

avatar image

Evans Bohl
115 6 11 15

avatar image Chippred Nov 30 '16 at 09:17 PM

Thank you for your help! :D

avatar image Evans Bohl Nov 30 '16 at 09:29 PM

No problem :D

avatar image Chippred Nov 30 '16 at 09:31 PM

The problem is that since it is a 3d game, if you press two of the movement keys at the same time, and then release one of them you will get an idle animation moving

avatar image Evans Bohl Nov 30 '16 at 09:39 PM

Oh I see, then maybe you should track the player inputs instead of the sprite velocity. That way, when there's no input, it will automatically put itself in idle state.

Here's a sample code. If you set the axis value of the input to a variable, you could track this variable (-1 for left, 1 for right).alt text Hope it helps ;)

walkinput.jpg (102.0 kB)
avatar image brunogbrito Nov 30 '16 at 09:36 PM

Using tick should solve your problem. Make sure to set your movements inputs in Edit/Project Settings/Input

avatar image Chippred Nov 30 '16 at 09:39 PM

i will try this! :)

(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