Boat NPC Movement

Hello, I’m trying to make an npc boat that attacks the player’s boat. But, I’m truly unsure on how to tackle this problem. I tried searching on devforum and on youtube to find any similar problems to no avail.

So far, I tried using body force and angular velocity, but I’m unsure on how to direct the boat to the player. Should I use CFrame or something?

Please help and thank you for your time.

1 Like

I’m unsure of what you’re trying to do I know you want a NPC Movement thingy but if you could explain in more simple words I could maybe help

Basically I want a boat follow the player’s boat. So in other words a npc that follows you. Sorry for my poor explanation. :sweat_smile:

try Model:MoveTo(), but if the boat is a humanoid, try Humanoid:MoveTo()

So instead of teleporting I want it to move like walk so is the only way to use a humanoid?

oh, I didn’t see the part that said it would teleport. Humanoid isn’t the only way, you could try to make it face it with a AlignOrientation and then a AlignPosition to move it towards it.

1 Like

I won’t be able to test currently, but I’ll try later! Thank you!

1 Like

you can try bodygyro and for following the player just make it always face the player’s boat so it always “follow”

1 Like

Sorry for my late response. Anyways how do I exactly use align orientation? I tried searching it up, but I didn’t really get it.
Here’s what I have so far:

for i,v in pairs(workspace:GetChildren()) do
	if v ~= npc and v.Name == "Boat" then
		local distance = (v.Main.Position-npc.Main.Position).Magnitude
		if distance <= 10000 then

			Allign.Attachment1 = v.Main.Attachment
			main.VectorForce.Force = seat.CFrame.LookVector * seat.MaxSpeed * seat.Torque
		end
	end
end

You give it two attachments and attachment 1 will rotate towards the second one. If this isn’t a good enough explanation, try checking the dev hub.

1 Like

Thank you it works? But is there anyway for the part to point towards the 2nd object? Sorry for wasting your time.

What’s the replacement for gypro? Since it’s depreciated currently.

It’s fine, I’m still unsure on how to solve this but I hope @22rock33 and @foxnoobkite can help.

1 Like

As of right now I think the solution lays on Body Gypro, but I’m still unsure how to use it even after research and I Body movers are quite depreceated.

I hope you can find a solution because it would be really cool.

1 Like

The alignOrientation replaces the body gyro. You could try setting the cframe to cframe.lookat(). (I recommend checking Roblox dev hub)

1 Like