Using Third Party Assets (Such as Third Person Shooter)
Options
Zergleb
✭
in Photon Bolt
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.
THank you for any help.
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?
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);
}
}
THank you for any help.
0
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.0
-
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.0
-
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.0
-
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.
0 -
You should be able to base that on the UNET integration.0