#Giving a player the ability to play animations on a rig that's not his character

1 messages · Page 1 of 1 (latest)

high scaffold
#

So i was making some kind of a game where the player will have some units that follow him, so how can i give the owner of these units the ability to play animations for them, like how roblox characters work, the client can play any animation on the client side and it'll replicate to the server side, is that possible?, and if it is, how can it be achieved?

broken sedge
#

Fortnite jonsey

stone rock
#

How are you S1?

broken sedge
high scaffold
outer quail
#

remote events obviously

icy bloom
#

you're cooked

fickle ruin
#

You need to play the animations in server script @high scaffold

high scaffold
#

Itll take alot of performance to do so

#

I was asking if there is a way to make it like teh player character

high scaffold
#

Understand the question first

outer quail
#

Understand that you DO NOT have a choice

fickle ruin
high scaffold
#

If u played an animation

outer quail
#

it is required, it's just that Roblox does it internally

high scaffold
sullen jettyBOT
#

studio** You are now Level 3! **studio

outer quail
#

it is literally internal

#

Do you not understand how networking works

high scaffold
#

In a local script u can load a animation and play it and itll repkicate to other players

high scaffold
outer quail
#

that is because that is default behavior

high scaffold
#

So there is a way to give the player ownership of a rig

#

That is my question

outer quail
#

if you want to give them ownership of every npc then you're going to have a TON of exploitation potential

outer quail
#

but suit yourself, it's setnetworkowner and it has to be called on the server

high scaffold
#

Npcs

outer quail
high scaffold
#

Just a visual thing

outer quail
#

you can teleport NPCs around

#

possibly even send tons of data unnecessarily

high scaffold
outer quail
high scaffold
outer quail
#

huh, almost as though I said that already

high scaffold
#

I was suspicious of that

outer quail
#

everything I am saying is rhetoric

high scaffold
#

But im not 100% sure

#

That is why i came here in the first place

outer quail
#

use remotes 🙂

high scaffold
#

Remotes arent the best thing for performance bro

#

Sending 1 sentence will take over 15 bytes

#

And ill be playing different animations

outer quail
#

do you understand how little 15 bytes is

#

because I don't think you do

high scaffold
topaz vector
#

A whole 15 bytes...

outer quail
#

It is huge

high scaffold
high scaffold
outer quail
#

@empty dune

#

get in here and tell this guy off for me

high scaffold
#

There is a whole built in library in luau for compressing data called buffers

#

Why did they make it in ur opinion

outer quail
#

I should know, I built a replicator that allows you to register classes for cross-network calls

#

USING buffers

#

(sad that it is still converted to json in Roblox though)

high scaffold
#

Then why ru saying that 15 bytes isnt huge

#

Ifbit can be compressed

outer quail
#

Because it is not

high scaffold
#

Then why not compress it

high scaffold
#

Npc

#

Each one has its own animations playing

#

Not every frame but itll change frequently

outer quail
#

if you want to compress a sentence then you could for example only use 26 of the 256 values in a byte for every character and unpack it however you figure

#

you can also use certain algorithms for "commonality" of characters

high scaffold
high scaffold
#

Cuz the npc movement is heing calculated on the client

outer quail
high scaffold
outer quail
#

same

high scaffold
#

Alr

#

I appreciate ur help

#

Ill try to do more research

outer quail
#

if you are trying to select which NPCs perform a specific animation I would recommend (for dynamic count of NPCs) a numeric id based structure along with numeric ranges, coupled with the specific (numeric) identity of the animation for quick dispatch and efficient memory usage

#

if they all do the same animation simultaneously then you should focus on just the animation identity ofc

high scaffold
#

Alr

outer quail
#

(animation id)(range of npc IDs) etc.

fairly simple RLE kind of thing

#

speak english

high scaffold
#

This si not exactly how the system should work but i appreciate ur intention for helping me

#

The system will play 3 animations really
Idle and running or walking (depends on if the player is running or walking ofc)

So the player might swtich from running to walking super fast, using remote events everytime the plyer switches anims feels wrong

outer rune
outer quail
#

😭

outer quail
#

but it probably can work that way too if you prefer not to use remotes for what would otherwise be inferred

#

so for every client, check which animation track is playing etc. and play it or whatever your situation is

#

But I forget if there is actually a way to detect WHICH animation TRACK is being played, because as I recall it doesn't store that anywhere which is just poor API design icl

high scaffold
outer quail
high scaffold
outer quail
#

that is how it knows to internally handle animation requests

#

you can also disable that if you hide it in workspace.Camera, but anyways

sullen jettyBOT
#

studio** You are now Level 4! **studio

outer quail
#

because the client would see a different humanoid, not the one on the server, due to the fact that workspace.Camera does NOT replicate any children

high scaffold
#

I dont get what u mean
Why will i need to prevent the players from playing anims locally

outer rune
#

Thank you Lou Bloom from Nightcrawler

outer quail
#

(which I would prefer)

high scaffold
#

Most games load animations on the client side

#

And play them there

outer quail
#

oh no I meant play the animation locally

#

but send the request through remote

#

to play it for other clients and/or the server

high scaffold
#

Its better if ur game has alot of animations that users can do
Because u can store all the tracks in a mfoule anf access them on the client without hacing to worry about server memory

high scaffold
high scaffold
high scaffold
#

Because of memory and that weird 256 animation tracks cap thingy

outer quail
#

still don't know why Roblox thought it was a good idea to make LoadAnimation but no table of animationtracks

#

average disinformation moment

high scaffold
#

Idk why

outer quail
#

ye

high scaffold
#

Even tho they're probably stored somewhere

#

Cuz if they're not how does roblox memorize the 256 animations that were loaded and whenu try to load 1 more animation it gives u a warning

#

Anyway thanks for ur help dude

#

Really appreciate that's