How to make a pet/robot fly?

  1. What do you want to achieve?
    We have robots in our game. Every player can unlock one. The goal of the robots is to pick up fruits at the conveyor and then go back to the plot of the player. But I don’t know how to make it fly without going through walls etc.

  2. What is the issue?
    I want the robot to fly to the place where it needs to go without going through walls and stuff.

  3. What solutions have you tried so far?
    I tried doing it with the pathfindingservice. But with pathfindingservice, it is only possible to make it always on a ground or platform, you can’t really make a flying pathfindingservice.

You’ll likely need to make use of a BodyPosition instance inside the pet.

Also an AlignPosition instance may be suitable for this use case.

Hi! Thank you for answering. But, how would that make the pet not go through walls? (And btw, it’s not a pet that is walking next to a player, but it is doing its own thing.)

Just enable the “CanCollide” property on the parts of the pet.

So with AlignPosition I have to set an attachment on the part where the pet needs to go to and also an attachment in the pet and then align the position. With Cancollide it is never colliding through a wall or something? Right?

When I enable it, it will stick to the wall and It won’t go to the side to pass the obstacle…

You could have it follow the player’s character.

But that is the thing. It is not a pet as in every other game. It is a thing that is traveling randomly around the map, so it doesn’t have to follow the player’s character.

You’ll likely need to make use of the PathfindingService then to direct the pet’s movement.

I already did that. But, pathfinding can’t make things fly…