As you can see in the video above, after printing
doin
, the black-grey thing should tween itself to that red part, however, it doesn’t. What should I do in this case? Is a code to provide required?
doin
, the black-grey thing should tween itself to that red part, however, it doesn’t. What should I do in this case? Is a code to provide required?
I personally won’t be the person to help you with this issue but for the person that does it would greatly help them if you provided a snippet of code to help provide a fix to this issue of yours.
local GModel = ReplicatedStorage.Models.GrappleHook:Clone()
GModel.GrappleBody.CFrame = Character.RightHand.CFrame
local GrapplerTweenPos = TweenService:Create(
GModel.GrappleBody,
TweenInfo.new(
Data.TweenTime,
Enum.EasingStyle.Linear,
Enum.EasingDirection.Out,
0,
false,
0
),
{
CFrame = Data.Target.CFrame
}
)
task.wait(0.1)
print("doin")
GrapplerTweenPos:Play()
task.wait(Data.TweenTime * 2 - 0.6)
GModel:Destroy()
There isn’t something more to it. (Server)
Try changing
CFrame = Data.Target.CFrame
into
Position = Vector3.new(Data.Target.CFrame.Position)
The actual same result happens. Even with CFrame = CFrame.new(Data.Target.Position)
Maybe target is created after Tween loads, try changing position into some part you created before and see if it works
The tween happens when a RemoteEvent is fired, and the Part is created on the Client. However, I give the part as a parameter, so the server can see it. I fire the remote before the part is created.
If the part is created on the client, then it should be tweened on the client. I’m not sure if it is even possible to tween a client-made part in a server script, but even if it is, there’s no reason to weigh the server down with such tasks as it might make the whole server laggy.
If you fire the remote that tweens the part before making the part, there’s no way the remote handler can see the part.
I don’t tween the server-made part, I tween the grey thing. Look at the video. And I got confused a bit, the red part is made before anything.
You need to fire remote after parts are created on the server. You can check if they are created on the server by :WaitForChild(), because of the delay between client and server.
I don’t think you can give a client made part to the server, pretty sure it will be nil when you try to access it on the server. Try giving the part properties.
-- CLIENT
local TargetPart = CreatePartAtPosGrapple:InvokeServer(Character,MouseHit) -- creating red part ON THE SERVER
CharLocalTweening:FireServer(Time * 2) -- character protection
coroutine.wrap(function()
task.wait(0.5)
ReplicatedStorage.Sounds.GrappleFire:Play()
Remote:FireServer({ -- the grey part tween
TweenTime = Time,
Target = TargetPart
})
end)()
I don’t see what’s wrong with anything.
I receive the same result. It just doesn’t want to tween!
Right. So I just watched my variables for mistakes and I saw the following:
local TweenService = require(ReplicatedStorage.Modules.TweenService)
And as I remember, the way I was supposed to construct the tween isn’t that way. I fixed it and now it works.
Thanks all of you!