#Is there a way to hard Cancel all lerps threads

1 messages · Page 1 of 1 (latest)

jovial anchor
#

I am trying to make a way to hard Cancel an lerp.

#

CLIENT Side game.ReplicatedStorage.Animations.RemoteEvent.OnClientEvent:Connect(function(Motor,CF)
pcall(function()
Motor.C0 = Motor.C0:Lerp(CF,.3)
end)
end)

#

the only thing i need to know here

leaden harness
#

you cannot a cancel a lerp its not a thread. A lerp is just interpolation between two cframes. Thats like saying you want to cancel the number 4, it makes no sense

jovial anchor
#

shall i use tweenservices so

leaden harness
#

Yes you can cancel tweens

civic plover
#

what are u trying to make that needs u to cancel the lerp

jovial anchor
civic plover
#

okay

#

then simply

#

save the starting motor c0

#

connect runserivce when u play

#

disconnect when u need to stop and

#

reset to starting motor c0

jovial anchor
#

igh

jovial anchor
#

the Client part to the code

#

Aka this one will not be able to gather informations

#

game.ReplicatedStorage.Animations.RemoteEvent.OnClientEvent:Connect(function(Motor,CF)
pcall(function()
Motor.C0 = Motor.C0:Lerp(CF,.3)
end)
end)

civic plover
#

u are constantly firing remotes?

jovial anchor
#

Yeah.. kind of, for making the Animations clients

civic plover
#

hold on lemme check ur code

jovial anchor
#

otherwise i dont have any other idea to do it, to not make the Server lag

#

ig

civic plover
#

ok hold on

#

tell me what ur trying to achieve

#

like gameplay wise

jovial anchor
#

it's an custom Animator that Act for client and Server
For Server it firectly fire event to the client making the Server Read the keyframetrack values Based of their timelines
then send the lerp motor to the client and a smoothnes, .3.
but if i wanna Make a Playing Another Animation while the last one still Playing, even throught i :stop it it'ill just feel Janky, buggy due to the lerp

civic plover
#

is there a reason ur making a custom animator

jovial anchor
#

yeah i am making CFrame Ainmations to act like an smooth animator, usable without exporting Keyframes

civic plover
#

ok alright

#

what about

#

server just sending the reference to the choppym1 for an example

#

and the client just reading it off its children

#

so 1 remote instead of constant

jovial anchor
#

oh that's an nice Idea

#

like an

#

Animator:FireAllClient("KeyframeName",character)

civic plover
#

yea

jovial anchor
#

the issue would be

#

the stopping

#

and events

civic plover
#

ok heres whta u can do

#

make a module in client that holds all animators

#

u register an animator by a function there right

jovial anchor
#

yh

civic plover
#

that way other scripts can call :Stop and :Play from this module

#

getting the animator instance

#

make sense

#

so like server tells client to play animation on x character -> client gets animator of x character from module -> calls play animation on animator

#

then say u want to stop it later

#

client gets animator from module -> calls stop on animator from module

jovial anchor
#

hm interessing

#

and so on

#

shall i still use lerps

civic plover
#

i mean why not same thing

#

though

#

i suggest

#

instead of a runservice connection seperately for all of them

#

maybe try 1 runservice connection that updates all of them?

jovial anchor
#

oh yeah

#

nice

civic plover
#

might help with performance

#

though not sure so test that out

jovial anchor
#

Alrighty ima try it

#

Also

#

I think i noticied FirringAllclient withit a tweenservice for Motor6D

#

does not seems to owrk

#

if the client recive the ordered value

civic plover
#

tween might be annoying

#

since ur constantly making and destroying tweens

#

lerp might be better here

jovial anchor
#

I feel like, the issue will comeback

#

the one

civic plover
#

lemme show u what i mean by the module

#

gimme a min

jovial anchor
#

igh

civic plover
#

test

#

cant send code?? bruh

jovial anchor
#

wt

sick glacier
#

upload to pastebin

civic plover
#

there we go

#

check this for an example

#

with something like this u can call from other local scripts and have them work together

jovial anchor
#

oh

civic plover
#

u understand the logic?

jovial anchor
#

yeah

#

i am gonna code it

#

ty

civic plover
#

u welcome

jovial anchor
#

yo

#

@civic plover

#

ru here

civic plover
#

wsp

jovial anchor
# civic plover wsp

I am kinda having few issue, with somme controller do you think u could help me

jovial anchor
#

nvm i figured it out