Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

How to create a charecter for a 2D top down game

Me and my team have been working on a game for a game jam. We have been working well in 2D arts and programming. Currently, I have borrowed a sprite from a website as the player in the game. I want someone to teach me how to create a 2D top-down character. Please help! urgent.

Best Answer

  • Accepted Answer

    Causing a New Situation

    Go to Scene > New Scene

    We will have a root hub of 'Other Node', and search up KinematicBody2D.

    KinematicBody2D permits us to move the item around utilizing information sources and it is helpful for making a person regulator.

    We should rename the hub to "Player":

    Furthermore save the scene as "Player.tscn":

    Adding Components – Sprite

    Presently we want to include a couple of parts our player.

    As a matter of first importance, we really want a Sprite, so we can really see what our player resembles (Later on, we will supplant it with an enlivened sprite hub, yet the present moment we're simply going to go through our sprite for setting it.)

    We will haul in one of the player sprites (for example Sprites > Player > player_s_0.png) into the scene, and rename the hub to "Sprite".

    We should set the situation to be the focal point of our screen (0, 0).

    Adding Components – Collider

    We will add one more youngster hub to our Player…

    Adding Components – Raycast

    At long last, we really want another part for our player–a Raycast2D.

    You can set the position/heading/max distance of a raycast, for instance, we are as of now shooting it from the center of our player downwards.

    On the off chance that it hits another collider, it will return the item it hit. We will utilize this to identify assuming we are checking out a foe or a chest so we can communicate with it.

    In the controller, ensure that the RayCast2D is 'Empowered'. Additionally, by minding 'Prohibit Parent', we can cause the beam to disregard the collider of the player (self).

    How about we save the Player scene, return to our primary scene, and drag in our player scene into the fundamental scene.


Sign In or Register to comment.