Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Yamz |
I have an enemy that is a rigid body, and has a sprite as a child.
I can modify its speed and rotation after instantiating it, but I cannot modify the sprite
var mob = Mob.instance()
add_child(mob)
mob.rotation = direction
mob.linear_velocity = Vector2(rand_range(mob.min_speed, mob.max_speed), 0)
mob.linear_velocity = mob.linear_velocity.rotated(direction)
try this way but it returns an error
mob/Sprite.texture = load("res://Img/yellow.png")
What error do you get, specifically.
jgodfrey | 2020-11-22 20:55
Parser Error: Can’t assign to an expression
Yamz | 2020-11-22 20:56