Topic was automatically imported from the old Question2Answer platform.
Asked By
baz1975
This line in the tutorial for making a new 2D game on your Godot Documentation webpage is not working:
var velocity = Vector2(rand_range(150.0, 250.0), 0.0)
mob.linear_velocity = velocity.rotated(direction) *
I’m not sure how to fix it. Any help would be appreciated.
I think the problem is with your Mob scene. Its root node should be of type Rigidbody2D but, according to the error, it’s a Node2D.
If that’s the case, you can right-click the root node in the Mob scene and use Change Type to set it to Rigidbody2D. Also, if the node type was wrong, you’ll likely need to change the top line of the Mob script from: