Im having issues getting it to play other animations, almost like the blend space position is stuck in one spot and whether input is given or not it'll stay in the same spot. If you have any ideas i would love to get some input
Got mine to work, for some reason assigning the Input.get_vector() to direction or as you call it input will give a coord but once assigned to blend position it would create a null value. To bypass this i just assigned Input.get_vector() directly to the blend position coord
@@dappapanda make sure you have an animation key frame assigned with the frames in animation player, click on the animation key frame and you can assign other animations to the key frames. if you're passing Vector2 into a var like direction and then using direction to change blend position it seems to come up null and default the blend position to (0.1,0.1).
hi sir, im having error to one of you video tutorial. could you help please? the one with the blue slime please help!!, Unity user. im having this error " NullReferenceException: Object reference not set to an instance of an object PlayerControls.EndSwordAttack () (at Assets/PlayerControls.cs:121) " after i put this code public void EndSwordAttack() { UnlockMovement(); swordAttacks.StopAttack(); }
God bless you my brother, you helped me in an unimaginable way and at the right time, thank you very much
Very cool good sir.
(if you're making an Isometric game)
class_name Player
extends CharacterBody2D
@export var speed : float = 50
@export var animation_tree : AnimationTree
var input : Vector2
var playback : AnimationNodeStateMachinePlayback
func _ready() -> void:
playback = animation_tree.get("parameters/playback")
func _physics_process(_delta: float) -> void:
input = Input.get_vector("left", "right", "up", "down")
var iso_input = Vector2(input.x * 2, input.y)
velocity = iso_input.normalized() * speed
move_and_slide()
select_animation()
update_animation_parameters()
func select_animation() -> void:
if velocity == Vector2.ZERO:
playback.travel("idle")
else:
playback.travel("walk")
func update_animation_parameters() -> void:
if input == Vector2.ZERO:
return
animation_tree["parameters/idle/blend_position"] = input
animation_tree["parameters/walk/blend_position"] = input
why my character keep walking even i released key?
Im having issues getting it to play other animations, almost like the blend space position is stuck in one spot and whether input is given or not it'll stay in the same spot.
If you have any ideas i would love to get some input
Got mine to work, for some reason assigning the Input.get_vector() to direction or as you call it input will give a coord but once assigned to blend position it would create a null value. To bypass this i just assigned Input.get_vector() directly to the blend position coord
@@100degeneracy7 can you further explain, mines is just playing the first animation assigned, it would also help if you could show your code
@@dappapanda make sure you have an animation key frame assigned with the frames in animation player, click on the animation key frame and you can assign other animations to the key frames. if you're passing Vector2 into a var like direction and then using direction to change blend position it seems to come up null and default the blend position to (0.1,0.1).
@@100degeneracy7 i still don't understand, do i need to change something with the code or???
Great video!! Wondering if the animation for platformer video is still relevant or needs to be updated
Great tutorial, very well explained as always, could you do the same with a non top down RigidBody2d player ?
can u plz make a video about cut scenes like a story before the boss
my stays on walk left if I'm moving or not. how do I fix it??
how do i go from 8:40 to 8:42?
It took me a minute to figure it out, but there is a little pencil icon next to the word idle in the blendspace2d box we created.
Thx u bro! U have helped me to solve my big problem! Like & sub
my characters keep walking even i already released key
also thank you
hi sir, im having error to one of you video tutorial. could you help please? the one with the blue slime
please help!!, Unity user.
im having this error " NullReferenceException: Object reference not set to an instance of an object
PlayerControls.EndSwordAttack () (at Assets/PlayerControls.cs:121)
"
after i put this code
public void EndSwordAttack() {
UnlockMovement();
swordAttacks.StopAttack();
}