#Platform w/ NetworkTransform

1 messages · Page 1 of 1 (latest)

faint thistle
#

Can I see a screenshot of your inspector with the platform selected?

#

Platform w/ NetworkTransform

lapis nexus
#

sure thing ^

#

just moving it along it's forward

faint thistle
#

Can I see your code that's moving the platform?

lapis nexus
#
public class TestPlatform : NetworkBehaviour
{
    private void Update()
    {
        if (IsServer)
        {
            transform.position += transform.forward * 0.5f * Time.deltaTime;
        }
    }
}
#

again learning NGO from Fusion so probably missing something dumb

faint thistle
#

All seems pretty standard. Maybe you need a Rigidbody on the platform?

lapis nexus
#

I've tried it

#

same issue 😦

faint thistle
#

But have you updated your code to move the rigidbody instead?

lapis nexus
#

when I was trying this earlier yes, let me do it now

#

does it matter if it's kinematic?

#
public class TestPlatform : NetworkBehaviour
{
    private Rigidbody _rb;

    private void Awake()
    {
        _rb = GetComponent<Rigidbody>();
    }
    
    private void Update()
    {
        if (IsServer)
        {
            _rb.velocity += _rb.transform.forward * 0.5f * Time.deltaTime;
        }
    }
}
#

now it's not moving at all

#

oh, fixed update derp

#
if (IsServer)
        {
            _rb.velocity += _rb.transform.forward * 0.5f * Time.fixedDeltaTime;
        }
faint thistle
#

I wouldn't move it by changing velocity, I would use _rb.MovePosition

lapis nexus
#

still not working 😦

#

have tried kinematic and non-kinematic

#

but not sure it matters

#

code is:

    private void FixedUpdate()
    {
        if (IsServer)
        {
            _rb.MovePosition(_rb.transform.forward * 0.5f * Time.fixedDeltaTime);
        }
    }
faint thistle
#

and this is only when you have a NetworkTransform applied that the collider doesn't want to move along with it?

lapis nexus
#

well I can't get a rigidbody to move at all

#

if I remove RB and network RB it works again, but yeah then the collider doesn't move

faint thistle
#

I can't seem to replicate your issue

#

is this a client only issue? Host and client?

#

@lapis nexus when you look in the inspector, the green outline that represents the box collider moves with the transform or no?

lapis nexus
#

yeah, but my player (the camera gizmo) is stuck

#

and I can walk around the collider as if it never left

faint thistle
#

Both cubes have Rigidbodies

#

and the small cube is a child of the big cube

#

Big cube is kinematic, the small cube is not

lapis nexus
#

what about moving along its forward instead?

#

maybe it's an axis thing? btw tysm for helping

#

but I doubt it ^

#

I am not doing any parenting btw

faint thistle
#

I would be parenting your player to the platform

lapis nexus
#

I will once the player is on it

faint thistle
#

btw, one thing I noticed

#

Is Kinematic on Rigidbodies gets set to false when I start the server

#

so you have to set it at runtime to be true for the platform

lapis nexus
#

I will definitely parent once I get this working

#

but parenting it shouldn't matter in this case, I should still be able to jump on the platform and it'll just move underneath me

faint thistle
#

What's your player's components look like?

#

Collider, rigidbody?

lapis nexus
#

here's a video of it

#

it's the same as the ClientDriven sample... just a character controller no rigidbody

#

I have no idea what could be causing it

#

maybe I should update Unity versions

#

I tried NGO 1.9.1 and still broken there

faint thistle
#

Your character is just running in to nothing?

lapis nexus
#

into the collider that's on the moving platform haha

#

I'm so confused

faint thistle
#

But seemingly nothing, right?

lapis nexus
#

yeah

faint thistle
#

That would lead me to believe you have some sort of desync with the platform

#

Meaning the entire platform, not just the collider, isn’t being moved somehow

lapis nexus
#

even though it looks like it is?

#

it appears to be moving

#

going to try a reimport..

#

nope

faint thistle
#

This is with the server started and just a host client playing?

lapis nexus
#

just a host

#

client + server

#

I tried a different transport

#

and still broken

faint thistle
#

If you want to upload your project to GitHub or Zip it and send it to me, just lmk

#

I’m curious to take a look

#

Because this is very weird lol

lapis nexus
#

yeah I can do it tonight! thank you.

lapis nexus
#

Yeah I’ve been using Unity for a very long time and haven’t seen this before

lapis nexus
#

of course I can't repro in a new project stripped down

faint thistle
#

Now that is weird lol

lapis nexus
#

only difference is my project uses HDRP

#

repro project is on URP

#

no way that can cause issues?

faint thistle
#

Yeah I'd doubt that

#

especially since you tried a reimport

lapis nexus
#

wtf

#

this is literally all the scene is...

#

I'm using the exact same player object in both

faint thistle
#

and the platform?

lapis nexus
#

identical

#

btw you have no business helping me this much but I really appreciate it 😆

faint thistle
lapis nexus
#

Same, I needed a break though. Time for Elden Ring

#

I will try HDRP project to make them identical

lapis nexus
#

okay trying unity upgrade

#

to latest 2022.3 LTS

#

I swear if this is just some dumb Unity bug

#

also I noticed my test project was on NGO 1.9.1 where my broken project was 1.8.1 due to Unity version differences

#

okay still nothing, exact same scene in every way

#

guess I'll start ripping stuff out

#

and see if that helps...

#

everything is version controlled so not a big deal once I find it

faint thistle
#

You want to zip it or let me pull the repo?

lapis nexus
#

it has a bunch of stuff I can't share unfortunately

faint thistle
#

np

lapis nexus
#

that's why I was trying a small repro project

#

OH

#

something I did just fixed it lol

#

need to backtrack

faint thistle
#

😆

lapis nexus
#

actually

#

I ripped everything out

#

and it's still happening

#

I'm tired I think I was looking at the wrong project

#

let me zip this up

#

can I friend you?

faint thistle
#

Sure

lapis nexus
#

so I can send a google drive link instead, can't upload directly here