top of page
作家相片Sheu Suki

Protagonist_CharacterAnimation

To make the character more attractive and easier to walk around the world, I add the ability of “flying” and “swimming” for the protagonist.

_______________________________________________________________

Flying system

Flying will decrease the energy, so I added some functions shown in the graph below. One thing that can be explained should be the “Increased energy” part. I write lots of branches here in order to prevent a bug. The energy will increase if I press "shift"(increase walking speed) during flying. If I do not have the last branch, the character will increase and decrease energy after pressing "shift" once during flying. That means the energy will not be filled or empty during flying.

_________________________________________________________________

Swimming system

There are lots of tutorials about swimming. I try to watch the tutor to get the inspiration to write the graph. However, I totally can't follow them. They are too complex and not suitable for my character. This is because my character only needs to float on water.

I can't get inspiration from the tutor, so I try to write the graph by using the knowledge I had learnt. Magically, it works as my imagination. I am extremely happy to get this success because I wasted lots of time learning the swimming system but failed by following the tutor on youtube.


I think I wrote a very simple graph to finish the complex graph shown on the internet. I think I am too persist in finding reference from internet.



Most of the tutor will first teach you how to float on water (Half on body on water and underwater). Actually, I fail to do this part already. I don't know which step I missed but I guess the reason may be "is swimming" function may need "Water Body Ocean" to operate. (You can see I use "is falling" and "is flying" directly. But I fail to use "is swimming" so I do not use it). All tutorials use this but my character does not need to flow on the ocean, it is too big to put it in the village. I use "Water Body Customs" instead because I think they are same. However, I still fail to make want I hope after follow the tutor.





Therefore, I think my character does not need to be floating by using a computer’s calculation. I add collision directly to let the slime walk on this collision box.


Put it near the water surface to make the character look floating on water (but actually walking on this collision box). The water surface will have up and down waving, so it looks like I put the collision above the water surface, but the result is good when playing the game. Actually, some tutorials show that characters who swim in the ocean will not follow the wave to move up or down, so my result is actually similar to them. One of the disadvantages to using collision may be the character can't dive. However, I don't need this function.


Then, I found that the character walking on the collision box does not mean the component overlaps. Therefore, I add a box above the collision box as the area to trigger animation. Then, I create the event, "Start swim" and "Exit Swim" to connect them with the SlimeMain_BP and the Animation BP of MainSlime connect the "is swim?" in the SlimeMain_BP.

__________________________________________________________________

Character movement


Komentáře


bottom of page