Using Third Party Assets (Such as Third Person Shooter)

Hi I was going through the tutorials and I noticed that there is a lot of code in special methods like SimulateOwner where you update your transform position due to input. And you are also using BoltNetwork.frameDeltaTime which I know is deferred at the moment to fixedDeltaTime.

public override void SimulateOwner() {
var speed = 4f;
var movement = Vector3.zero;

if (Input.GetKey(KeyCode.W)) { movement.z += 1; }
if (Input.GetKey(KeyCode.S)) { movement.z -= 1; }
if (Input.GetKey(KeyCode.A)) { movement.x -= 1; }
if (Input.GetKey(KeyCode.D)) { movement.x += 1; }

if (movement != Vector3.zero) {
transform.position = transform.position + (movement.normalized * speed * BoltNetwork.frameDeltaTime);
}
}
So my question is what happens when I use the ThirdPersonShooter asset that I bought and it's not using SimulateOwner and BoltNetwork.frameDeltaTime? Is there a technique for working around this?

THank you for any help.

Comments

  • I am using a paid asset but if answering this question in context of using the FPS asset in standard assets is easier to research then I'm fine with that. I'm just looking for a technique that involves extending what I already have instead of rewriting.
  • ZerglebZergleb
    edited June 5
    So I implemented a quick move script and right away it seems apparent that there is more lag using the external move script than moving inside simulateowner. Is there a way I can quickly update without rewriting all the code.
  • SimulateOwner is basically just FixedUpdate that only runs if you are the owner of the entity, it is nothing special. Opsive is working on Bolt integrations, I would contact them.
  • Ok I spent some time looking into doing this myself.... and even though I said above that doing things in update seems to be laggy using TPS is working great so far. Just to document I need code that removes the IK, ControllerHandler and RigidBodyCharacterController from the entity upon Attach unless entity.isOwner is true but it's working great now(Except one error I'm getting I put in another post). I guess I let that one thing I mentioned made me create some false assumptions I'll try to see if syncing TPS health will work easily or if I need to do some complicated syncing on property change events.

    Thanks for the help.


  • You should be able to base that on the UNET integration.
Sign In or Register to comment.