#Platform w/ NetworkTransform
1 messages · Page 1 of 1 (latest)
Can I see a screenshot of your inspector with the platform selected?
Platform w/ NetworkTransform
Can I see your code that's moving the platform?
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
All seems pretty standard. Maybe you need a Rigidbody on the platform?
But have you updated your code to move the rigidbody instead?
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;
}
I wouldn't move it by changing velocity, I would use _rb.MovePosition
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);
}
}
and this is only when you have a NetworkTransform applied that the collider doesn't want to move along with it?
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
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?
yeah, but my player (the camera gizmo) is stuck
and I can walk around the collider as if it never left
Both cubes have Rigidbodies
and the small cube is a child of the big cube
Big cube is kinematic, the small cube is not
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
I will once the player is on it
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
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
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
Your character is just running in to nothing?
But seemingly nothing, right?
yeah
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
even though it looks like it is?
it appears to be moving
going to try a reimport..
nope
This is with the server started and just a host client playing?
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
yeah I can do it tonight! thank you.
Yeah I’ve been using Unity for a very long time and haven’t seen this before
of course I can't repro in a new project stripped down
Now that is weird lol
only difference is my project uses HDRP
repro project is on URP
no way that can cause issues?
wtf
this is literally all the scene is...
I'm using the exact same player object in both
and the platform?
identical
btw you have no business helping me this much but I really appreciate it 😆
I like problem solving lmao
Same, I needed a break though. Time for Elden Ring
I will try HDRP project to make them identical
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
You want to zip it or let me pull the repo?
it has a bunch of stuff I can't share unfortunately
np
that's why I was trying a small repro project
OH
something I did just fixed it lol
need to backtrack
😆
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?
Sure
so I can send a google drive link instead, can't upload directly here