WHAT
Developer Relations Technical Artist continues showing you the basics of building a side-scroller, using Paper 2D. You’ll cover creating sprites, flipbooks, tilemaps, basic movement/abilities, creating obstacles, and a simple UI using the UMG UI Designer.
Feel free to ask any questions on the topic in the thread below, and remember, while we try to give attention to all inquiries, it’s not always possible to answer everyone’s questions as they come up. This is especially true for off-topic requests, as it’s rather likely that we don’t have the appropriate person around to answer. Thanks for understanding!
I’m guessing that because the character itself has variable force when falling from the jump, that variable force is being added or removed to the force applied on hit. For example, if the character is falling with Z force 3000, and you’re applying -5000 Z force, the the resulting force is only -2000. But on another jump, he might be falling differently and the force itself is different. There’s probably some function to get the character velocity/forc and you can probably use it to add/remove the difference between character fall and the force applied to AddForce, but like I said, I’m guessing… I’ll check it out if I can, and I’m sorry if I didn’t make much sense!
Here’s the graph from my master project. I’ll have to go back to the replay and see what I missed during the heat of the Livestream moment, but you’ll notice a couple things:
1.) This is the working blink effect. (That I’ve used a dozen times in various projects!)
2.) I added “Stop Movement Immediately” to zero out any velocities on the Character Movement Component. That works, though I still get curious results. Sometimes a knockback force of X will throw me back Y units, and then other times it will throw me back 100*Y units. It kinda seems like a bug, as the variability in knockback is consistent when it randomly switches. I’ll be speaking with our physics people shortly.
For kicks, I might try testing and setting the “IsHit” boolean in order to mitigate the possibility that the hit event is being triggered multiple times on the overlap.
Thanks Voradorpt/Alan - Ill give that a go. It did seem to work randomly when i made the trigger box bigger but only when travelling right to left! All very odd.
I got the flicker working using a flip/flop between hidden and not hidden which seemed to work well too.
After discussion with our people in charge of Physics and Character Movement, I learned that “Add Impulse” is what we actually want. Apparently the Character Movement component has some amount of custom code that enables it to do what it does and “Add Impulse” is designed to work with that system, rather than the Physics system directly.
I’ve done a bit of testing with this new config and thus far is reliable. In addition, the values we can now use for the knockback forces are more comprehensible for those of us that don’t like to deal in big numbers.
Quick question, how would you go about using two different flipbooks for standing, running, shooting, etc., if you have an asymmetrical character. As it stands your using the same flipbook animation for the left and right, because the sprite is symmetrical.
An example being, if the character has a blaster on their left arm. When looking to the right side of the screen, the left arm would be behind the character, and when looking to the left side, the left arm would be in front of the character.
In the character we’re using in the stream, you’ll see there’s a test on the values coming out of the “Right” axis to determine which direction the player is pushing. After deciding whether or not it is < or > zero, the sprite is flipped and the same running animation is played.
You would pick a different running animation to play off of one of the directions. You’d do the same for all of the animations that had a Left/Right version.
Before all that though, you may want to ask yourself if doubling the art size, the authoring effort, and the implementation time is really worth it!
Thanks for the feedback. I’m happy to keep going with this project for as long as you all find it worth while.
Fair enough! Actually, that probably is a good learning exercise.
I wanted to get into tilemaps last time, but encountered a couple of issues right before the stream. I need to speak with some folks over here about them before I start sharing practices.
Alan, I was curious if you could help me out. I’ve managed to get the blinking under control (I shrunk the Timer time to .02 seconds and the Delay to .2 seconds) and knockback never seemed to give me trouble, but, trying to stop the character from moving after they get hit doesn’t seem to work – it seems to nullify my sitting animation. Do you know what might be causing this or how I can fix it?
P.S.: Thank you, I’ve been learning a lot from this series.