I have a npc which is positioned in the deck of a flying ship (the ship goes up and down using tween animations).
When I run the studio on the very first 10-12 seconds the NPC simply floats in the air when the ship goes down and sink in the ship mesh when the ship goes up, after this time (~10 seconds), everything starts to work fine.
I have absolutely no clue on what am I doing wrong, so hopefully somebody can assist me with this issue.
Just in case, I’m also attaching a picture of the NPC part hierarchy and some other properties.
Well what I don’t get is the reason for this erratic behaviour… not sure if you guys watched it, but it works like expect after a few seconds.
Regardless thanks for the replies.
@BaggyChris how anchor the Humanoid would help to fix the issue? Also what you mean by welds? I think the welding is alright, I mean I know it’s alright for animation purposes at the very least, the only part I don’t have welded is the HumanoidRootPart, because I’m not sure where to weld it too. Do you think it may be the issue?
Is the ship made out of meshes, and if so, can you walk on it like the npc did? If you can, then you should turn on PreciseCollision if that’s what it’s called, it has happened to others before.
Usually if there is an animation that is poorly coordinated and the ship is a mesh (you can walk on it normally true/false doesn’t matter) it can cause flying of the npc.
The tween script is connected to the Airship, and seems to be working fine, also my player walks perfectly on top of the Airship, regardless here it is:
local goalUp = {}
local goalDown = {}
local upY = AirshipPos.Y + 2
local posUp = Vector3.new(AirshipPos.X, upY, AirshipPos.Z)
goalUp.Position = posUp
local downY = AirshipPos.Y - 2
local posDown = Vector3.new(AirshipPos.X, downY, AirshipPos.Z)
goalDown.Position = posDown
local tweenInfo = TweenInfo.new(8, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut)
local tweenUp = TweenService:Create(Airship.PrimaryPart, tweenInfo, goalUp)
local tweenDown = TweenService:Create(Airship.PrimaryPart, tweenInfo, goalDown)
tweenUp.Completed:Connect(function(playbackState)
tweenDown:Play()
end)
tweenDown.Completed:Connect(function(playbackState)
tweenUp:Play()
end)
tweenUp:Play()
After a lot of tests I couldn’t reproduce this so I have no idea why it is doing that. Hopefully someone with more knowledge runs across this post and has the solution. Good luck!
Really appreciate the time and effort, I’m sure at some point I’m going to get this thingy fixed.
I guess the reason why you couldn’t reproduce it was because you didn’t have the Airship mesh.
Just had an idea, obviously feel free to refuse, but I think I can add you to the project team so you can see exactly what’s going on… let me know if you feel like do it.
Hey guys, just want to share an update to my issue:
Doing some extra test, I managed to capture this little video:
The instance on top is the server, the instance below is the client, as you can see… for a pretty much the same time (~10 seconds) the NPC behaves perfectly (server side) and wrongly client side, after this time the problem (which isn’t really a problem) is the other way around.
I’m pretty sure is that what may be causing the issue is the fact the ballon is animated at client level, where’s the NPC is get spawned from the replicated storage.
I think just by moving the ballon to the replicatedStorage may fix the issue, although I’m not 100% that’s the right medicine.
So before do anything I would like to hear from more experience devs like you guys.
Once again, I want to thank in advance for the help.