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"

Character rushes across screen after direction change

Hey guys,

got a little problem here: I made a simple 2D game to practice Blueprint scripting. Everything works fine so far, with the little but grave exception that when I jump and keep the jumping direction pressed, but do a direction change the exact moment my character touches the ground, he rushes away in the direction he is now facing.

I've made a short video showing what my problem is (it's kind of hard to explain). It occurs first at about 0:17 and can be seen four times: http://youtu.be/27eWYzU-CTI

I'll attach my movement Blueprint as well (contains additional flipbook settings).

Could this be a mistake I made or is this some kind of standard "feature" that I do not know of? Or could it be an engine bug?

Thanks for the help! :)

PS: I use some sprites from Nintendo in the video. I hope this is fine, as it is only a practice game. If this is a problem, please feel free to remove the link.

alt text

Product Version: Not Selected
Tags:
more ▼

asked Jul 29 '14 at 09:16 PM in Blueprint Scripting

avatar image

Artax
68 4 8 12

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

3 answers: sort voted first

Hey, Artax!

I've been looking at your question for a while and I think I might know why it's happening.

I'm not completely certain on how your axis value is set up, but I think if you're turning when you land, it causes an unexpected Axis value which increases the Scale Value in your Add Movement Input function to a crazy-high amount. That's why you're suddenly flying off to the side. If you want to check and see if that's the problem, you could try having a Print String node that prints the Scale Value value and see if it goes crazy-high when the bug surfaces. Just a suggestion. :)

Let me know if that helps,

Jonathan

more ▼

answered Jul 31 '14 at 05:56 PM

avatar image Artax Jul 31 '14 at 07:42 PM

Hey Jonathan,

thanks for your time and the suggestion! I've just tried it, but the value shows no abnormality whatsoever (neither the axis value, nor the final input value, I looked at both).

Interestingly enough, I made these 2 new observations:

  1. the phenomenon only occurs when I keep the first directional key pressed right up to the moment when I want to switch directions. Leaving the button unpressed just a split second earlier doesn't trigger the "side jump".

  2. I was able to reproduce the phenomenon while walking on the floor as well, if the timing is right.

Any other ideas where that may come from?

avatar image Jonathan Dorman STAFF Jul 31 '14 at 07:53 PM

Hmm. Do you think it's possible that your character is somehow taking movement input from both left and right at the same time?

I assume your 'MoveLeft' section looks just like this, with a different rotation multiplier?

avatar image Artax Jul 31 '14 at 08:06 PM

Uhm... there is no MoveLeft ^^ All input comes from this one "InputAxis MoveRight" node, positive and negative, respectively.

avatar image Jonathan Dorman STAFF Jul 31 '14 at 08:19 PM

Oh! I see that now.

Do you think the bug is caused by the game taking a left and right input at the same time? Maybe use a Branch to prevent both inputs from happening together and see if that helps?

avatar image Artax Jul 31 '14 at 09:55 PM

Hm... How would you set up that branch? Sorry, I seem to be slow on the uptake at the moment ^^ Maybe I should take a break. This is what I just tried, but it does not solve the issue:

alt text

speedrun_tick.jpg (60.2 kB)
avatar image Jonathan Dorman STAFF Aug 01 '14 at 02:45 PM

Hey, no worries. I realized I'm being a little slow on the uptake too. I finally figured out that you're using a modified version of the Sidescroller Blueprint, so I opened that up and took a look. It looks like the way the Sidescroller Blueprint is set up prevents taking left and right inputs at the same time, so that's not the problem.

I'm going to try to emulate your blueprint setup and see if I can reproduce the bug. I haven't succeeded yet, but I'm working on it.

In the meantime, have you tried wiring InputAxis MoveRight directly to Add Movement Input? If that fixes the problem, that means that the bug involves the Flipbook and Set Actor Rotation part of the blueprint.

avatar image Artax Aug 02 '14 at 03:38 PM

Oops. I could have mentioned that I used the template ^^

I tried wiring the Inputaxis event to the AddMovement, but the error still occurs. In case you're not able to reproduce the bug, can I be on any assistance, maybe by putting the whole project into our SVN?

avatar image Jonathan Dorman STAFF Aug 04 '14 at 03:45 PM

If you could send me your project, that would definitely be very helpful. Rather than SVN, could you upload it to Dropbox or Mega and send me the link over private AnswerHub messages?

Thanks!

avatar image Jonathan Dorman STAFF Aug 19 '14 at 02:14 PM

Okay, I've made a lot of discoveries, but the issue is still eluding me.

Here's what I've got so far:

First off, the 'flying to the far side of the screen' bug is caused by a smaller 'teleport (or move very quickly) a short distance' bug. Even if you're on the ground, tapping A and D repeatedly can sometimes make your character dash to the side a little bit. If you do that while standing on a block, then you'll fly off to the side (like you showed in your video).

However, that little teleportation bug is crazy hard to track down. I've removed almost all of the blueprint and nearly all of the related assets, but the bug still persists.

alt text

I've deleted everything else. The only things that remain are this, and the TetriskCharacter Defaults. The character is no longer visible, but I have the camera following him so I can tell when he teleports, and it still happens. That means it's not part of your event graph, because the Blueprint 2D Side Scroller character doesn't have this bug, even when you simplify his blueprint to this.

The only thing I can think of to try now is to make a new Character and just copy the old one's components and stats to the new one until the bug resurfaces.

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

Hey Jonathan,

sorry for the late answer. I have uploaded the project to my Dropbox. Now this may sound like a stupid question - but how on earth can I send a private message? ^^

more ▼

answered Aug 07 '14 at 09:57 PM

avatar image

Artax
68 4 8 12

avatar image Ben Halliday STAFF Aug 07 '14 at 10:22 PM

Hey Artax,

AnswerHub doesn't have a private message feature, but you can send Jonathan a PM on the forums:

https://forums.unrealengine.com/

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

Hey Jonathan,

Yay! I was just creating the new character as you proposed and I think I found the problem! I've set the "Ground Friction" to a very high value to better imitate the movement of Mario. Seems like 1000 was a litte too much :) I've reduced it to 200 and wasn't able to reproduce the bug anymore.

Would be great if you could try and confirm this discovery!

more ▼

answered Aug 21 '14 at 11:31 PM

avatar image

Artax
68 4 8 12

avatar image Jonathan Dorman STAFF Aug 22 '14 at 01:16 PM

Excellent! When I set the friction to 200, I can still reproduce it sometimes (by tapping A and D repeatedly), but setting it to an even lower number (like 5) makes it completely disappear. Finally!

I'm glad we finally found the root of this problem, I was getting pretty concerned!

(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