#How can I add a NetworkTickSmoother at runtime?

13 messages · Page 1 of 1 (latest)

dusky jackal
#

I spawn in my player's visuals at runtime now and I can't get tick smoothing to work. Previously I had the tick smoother components for each graphical object on the root player and just dragged in the child object references I needed, which is now not possible.

There doesn't seem to be a way to access the graphical object variable in the tick smoother script. Even when I added the components to the root object via AddComponent and tried setting the graphical object with a setter method I added, the console gets spammed with errors that the graphical object field is not set. However the inspector shows them as assigned so I'm confused here.

#

This is the version of the NetworkTickSmoother I have btw (with the setter I added right under the serialized graphical object field)

vivid laurel
#

Hi there, have you tried using the OfflineTickSmoother instead with the SetTargetTransform method?

dusky jackal
vivid laurel
dusky jackal
# vivid laurel I see, you may be able to use the MonoTickSmoother then

Yep that worked, just had to make Initialize public instead of being called from OnEnable and call it with the graphical object as a parameter, so it gets set before initializing.

I dont typically change things with unity packages so i assume this may be overwritten/rolled back. Is there a way I can make a version of the script outside the packages folder? I tried before but i get a bunch of errors since it cant access the internal classes

vivid laurel
dusky jackal
vivid laurel
#

This is working fine for me:

dusky jackal
vivid laurel
#

I said Assembly Definition before, my mistake