- Code: Select all
local dir = vector.direction(pos, tpos)
local velocity = {
x= self.max_speed* dir.x,
y= self.max_speed* dir.y,
z= self.max_speed* dir.z,
}
local new_yaw = minetest.dir_to_yaw(dir)
self.object:set_yaw(new_yaw)
self.object:set_velocity(velocity)
But the mob moves in a straight movement.
Any help?