I’m a beginner and need help
thank you that was very helpful but do you know how to make your character with code?
Hohoho, Sanata would say, I do not! I’m sorry, I’m just an animator. Programming is far beyond my understandings
with code… code code code… I’m kinda the code-y person, so here’s what i’d do.
I would make a clip of the walking animation, then move the whole clip. If you don’t know how to do it, just let me know.
I’m not sure if there would be any way to animate using code without using some super complicated code, maybe using clone() or maybe using code to alter the x coordinate, the y coordinate and the rotation, but it would just be very complicated. I would suggest just to stick to animating it.
thanks for the tip
thank you for the help i will try
Hey @1w_Chris, you may want to look into the moving character example as well. You can add it to your project by
- Opening the built-in asset window
- Selecting the “Keyboard controlled” option. (This will add it to your asset library).
- Drag the keyboard controlled option over to the canvas from the asset library.
- You’ll have a controllable character in your project! Press the arrow keys to move it while your project is playing.
Also, you’ll be able to see this code inside the object that makes it work.
var speed = 7;
if(isKeyDown('left')) {
this.x -= speed;
}
if(isKeyDown('right')) {
this.x += speed;
}
if(isKeyDown('up')) {
this.y -= speed;
}
if(isKeyDown('down')) {
this.y += speed;
}
And lastly, here’s a video that you might want to check out if you’re stuck!