• Home
  • News
  • Software
  • Knowledge
  • MMO
  • Tips
  • Security
  • Network
  • Office
AnonyViet - English Version
  • Home
  • News
  • Software
  • Knowledge
  • MMO
  • Tips
  • Security
  • Network
  • Office
No Result
View All Result
  • Home
  • News
  • Software
  • Knowledge
  • MMO
  • Tips
  • Security
  • Network
  • Office
No Result
View All Result
AnonyViet - English Version
No Result
View All Result

[Godot RPG] #2: Character

AnonyViet by AnonyViet
June 3, 2025
in Tips
0

First you need to understand what RPG is: RPG English is the Role Playing Games, RPG is the type of game that the player will play the role of the character in the game to fight in turn or in real time.

Join the channel Telegram belong to Anonyviet 👉 Link 👈

In this section we will create characters. Accompanied by State Machine with Animation Tree with Godot

Before that, please download the Asset for me.

Link

Here we will use Spritesheet.

Figure

Sprite

First, we will remove the image of the character into Sprite as usual.

[Godot RPG]  #2: Character 29

Notice the Inspector column (Inspector)

There will be VFrames and HFrame who have done with tutorial first.

  • Vframes is the length of spritesheet
  • HFrames is vertical of spritesheet

Here:

  • Hframes equals: 13
  • Vframes equals: 16

[Godot RPG]  #2: Characters 30

After the set is finished, you will see

After you finish the 2 sets, you will see the small player as usual.

Collisionshape2d

You set Collisionshape as a picture because this is the Topdown RPG game, not the first type of game like tutorial.

[Godot RPG] #2: Character

Animation Player

You create node animation player

[Godot RPG]  #2: Character 32

Then create a new Animation will include:

  • IDLE: Stand still
  • Run: run
  • Attack: attack
  • Dead: Dead

Then next to create a new track for me in Animation Idle

[Godot RPG]  #2: Character 33

Then select Sprite

[Godot RPG]  #2: Character 34

Then select Frames

[Godot RPG]  #2: Characters 35

Then right -click to select Insert Key and then Insert so that it is equal to the frames number of Animation

[Godot RPG]  #2: Character 36

Here I will let the image have the frames. I don’t know what other engines, but Godot is like this

[Godot RPG]  #2: Character 37

Then I will insert key equal to frames numbers

In idle, it is 12 so I will insert 12 key

You can use the bottom bar to adjust the small level

[Godot RPG]  #2: Character 38

Use the bottom to adjust the track time

[Godot RPG]  #2: Character 39

So I finished adjusting, you do the same.

State Machine with Animation Tree

State Machine: Means a state -owned machine, with State Machine you can manage your actions easier and the State Machine is different from Finite Machine. At Godot, there is node as animationtree that makes it easier to perform State Machine

You add node animationtree for me

[Godot RPG]  #2: Characters 40

In the place, Treeroot selects Nodestatemachine

At the Assginplayer

[Godot RPG]  #2: Character 41

Then right -clicked all the newly created animations

[Godot RPG]  #2: Characters 42

Here then

Pink: Connect (arrow helps signal transmission)

Green: delete

Purple: When there is this, the Animation will run first at the beginning

Orange: Animation last just need to run animation with this = stop

[Godot RPG]  #2: Character 43

Here I will connect idle with other animations

[Godot RPG]  #2: Characters 44

As the picture above, IDLE will connect via Attack, IDLE can transmit data via Attack but it cannot be transmitted because Attack does not have the plan to tell idle.

[Godot RPG]  #2: Characters 45

As the picture above, the two sides were connected to each other. So when we are in Idle, click attack it will run Attack and after the Attack ends it will run back to idle.

Please connect with the rest. There is a dead, only connect from Idle to only because when you die and then return IDLE to do: D?

[Godot RPG]  #2: Characters 46

I will assign a start in Idle so that when you boot, the player will stand still, right? So when standing still it will run Animation Idle. But when you first ran the game that the player was standing still and running the Animtion Run or Attack.

[Godot RPG]  #2: Character 47

And assign End at Dead. When dying, what else do you run: D.

So it has finished the Animation Tree is the code

Code

Here, we will use an object -oriented code.

Create yourself the enum containing State machine (Status neck) Including IDLE, RUN, Attack, Dead and 1 status will be equal to IDLE.

[Godot RPG]  #2: Characters 48

Then next we must determine each state when acting. Here I will use match (like case/switch) and change the name laydau nhapvao wall trangthai_move

[Godot RPG]  #2: Character 49

Next I need to access Animatinotree To be able to run Animation and turn on Animationtree Then I will have a statement:

[Godot RPG]  #2: Character 50

Then next I have to check if the player is standing still, it will run Animation Idle if not standing still means moving, it will run the animation moving and check when the player moves to the right it will rotate the right and when the player move left, it will turn to the left.

[Godot RPG]  #2: Character 51

[Godot RPG]  #2: Characters 52

Next, I will create a camera to easily see.

[Godot RPG]  #2: Characters 53

Then when you move, you will see it turning left and right to run animation.

So you’re done appointments to the next lesson

Previous Post

Gemini Live on iOS: Camera sharing feature and new screen

Next Post

Apple Pay supports NAPAS cards: The future of non -contact payment in Vietnam

AnonyViet

AnonyViet

Related Posts

How to see your email account creation date
Tips

How to see your email account creation date

November 11, 2025
Microsoft’s ranking of the 10 best Windows versions
Tips

Microsoft’s ranking of the 10 best Windows versions

November 11, 2025
Recover deleted data on Windows 10 with Windows File Recovery
Tips

Recover deleted data on Windows 10 with Windows File Recovery

November 10, 2025
Tips

Why hasn’t your computer been updated to Windows 10 2004?

November 9, 2025
3 OCR Tools Extract Text from Images without Retyping
Tips

3 OCR Tools Extract Text from Images without Retyping

November 8, 2025
Ways hackers use to hack your Facebook and how to fix it
Tips

Ways hackers use to hack your Facebook and how to fix it

November 7, 2025
Next Post
Apple Pay supports NAPAS cards: The future of non -contact payment in Vietnam

Apple Pay supports NAPAS cards: The future of non -contact payment in Vietnam

0 0 votes
Article Rating
Subscribe
Login
Notify of
guest

guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments

Recent News

How to install Anh Hai’s Pho Shop on MacBook is super easy

How to install Anh Hai’s Pho Shop on MacBook is super easy

November 11, 2025
How to turn off ads on Yoosee app in just 1 minute

How to turn off ads on Yoosee app in just 1 minute

November 11, 2025
Windows 11 and MS Office 2021 lifetime license, genuine from  during Keysoff’s 11.11 sale

Windows 11 and MS Office 2021 lifetime license, genuine from $14 during Keysoff’s 11.11 sale

November 11, 2025
How to see your email account creation date

How to see your email account creation date

November 11, 2025
How to install Anh Hai’s Pho Shop on MacBook is super easy

How to install Anh Hai’s Pho Shop on MacBook is super easy

November 11, 2025
How to turn off ads on Yoosee app in just 1 minute

How to turn off ads on Yoosee app in just 1 minute

November 11, 2025
Windows 11 and MS Office 2021 lifetime license, genuine from  during Keysoff’s 11.11 sale

Windows 11 and MS Office 2021 lifetime license, genuine from $14 during Keysoff’s 11.11 sale

November 11, 2025
AnonyViet - English Version

AnonyViet

AnonyViet is a website share knowledge that you have never learned in school!

We are ready to welcome your comments, as well as your articles sent to AnonyViet.

Follow Us

Contact:

Email: anonyviet.com[@]gmail.com

Main Website: https://anonyviet.com

Recent News

How to install Anh Hai’s Pho Shop on MacBook is super easy

How to install Anh Hai’s Pho Shop on MacBook is super easy

November 11, 2025
How to turn off ads on Yoosee app in just 1 minute

How to turn off ads on Yoosee app in just 1 minute

November 11, 2025
  • Home
  • Home 2
  • Home 3
  • Home 4
  • Home 5
  • Home 6
  • Next Dest Page
  • Sample Page

new88 trang chủ shbet trang chủ f168 trang chủ qq88 nhà cái 78win

No Result
View All Result
  • Home
  • News
  • Software
  • Knowledge
  • MMO
  • Tips
  • Security
  • Network
  • Office

new88 trang chủ shbet trang chủ f168 trang chủ qq88 nhà cái 78win

wpDiscuz
0
0
Would love your thoughts, please comment.x
()
x
| Reply