How to avoid using server scripts for rigs as doing this makes linear velocity jitter

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    I want to make it so that the npc’s (default Roblox rigs) are able to take knockback using linear velocity not using a server script as the server doing this somehow makes linear velocity jitter whereas using a client script would fix this

  2. What is the issue? Include screenshots / videos if possible!
    The problem is that rigs can’t use local scripts so they can’t use the .OnClientEvent I was planning to use so I am kind of stumped on what to do.
    image

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I have tried looking at other posts in the developer hub but can’t find anything related to the problem I am having. I have found a way for it to work by using body velocity through a server script but I want to refrain from using deprecated methods.

You would either have to make the NPCs local, which to do so I will link a video, otherwise you can set the network ownership of the NPCs to nil which would make them controlled by the server, then you can apply the knockback on the server.

The bug with linear velocity is being resolved by @DrCherenkov

You can use ApplyImpulse for knockback, it would work great.

Just want to clarify what the video does on the local NPCs part of the video because it is kind of confusing to me.

You can use local scripts to control NPCs if the local script in ReplicatedFirst and the things that you change in this script changes for everyone and not just one person. Please correct me if I am wrong. Also how would I use :FireClient to this script since it isn’t a player.


Jitters a bit
image

Just need to tweak the knockback, might need more upwards force or something

still doesn’t work I am just going to use body velocity until I find another solution

Body velocity got deprecated Sadly

Local scripts works as long as they are in a humanoid so no worries

Just wondering, what formula did you use to calculate the knockback?

Yeah I don’t understand how it could be stuttery, I’m testing it on the player and I’m not having any trouble.

the knockback is only the lookvector of the player hitting multiplied by about 500

For the apply impulse

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.