Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Changing the transform of entities on server doesnt work #326

Closed
FoolHen opened this issue Jul 20, 2018 · 3 comments
Closed

[Bug] Changing the transform of entities on server doesnt work #326

FoolHen opened this issue Jul 20, 2018 · 3 comments

Comments

@FoolHen
Copy link

FoolHen commented Jul 20, 2018

entity.transform = newtransform only works on client. Seems like it's readonly on server. As a testmod you can use https://github.com/3ti65/BlueprintManagerTest with https://github.com/Powback/BlueprintManager , spawn and type in chat spawnrp server and then moverp server. You can see that the client truck moves on client but not on server (the collision doesnt move). Use XP3_Shield ConquestLarge0 2

@Powback
Copy link

Powback commented Jul 23, 2018

This is only an issue for GameObjects that should move dynamically, like windmill blades which doesn't have collision in retail, I suspect that it's intended.

As a workaround for the map editor, we can simply destroy the old GameObject and replace it with a new one. This doesn't work if the GameObject has damage-states, but that's not supported right now anyway.

@Powback
Copy link

Powback commented Aug 3, 2018

I've looked further into this issue.

Spawning an object does indeed create the StaticPhysicsEntity on both the server and the client, but it isn't caught by the EntityFactory hook, and it doesn't seem to be added to the entity list when spawned using EntityManager:CreateServerEntitiesFromBlueprint.

By using raycasts I can successfully catch and move the collision clientside.
So it seems like we need a way to access the physics entity that's connected to the spawned GameObject somehow.

Similarly, it would be useful if the PhysicsEntity could be connected to the GameObject. That way we could use raycasting to select and move GameObjects. Right now, raycasts only hit the PhysicsEntities, which is expected.

Also, when moving PhysicsEntities, it seems like the transform is updated ingame, but entity.transform outputs the same.

@Powback
Copy link

Powback commented Aug 14, 2018

Bypassed by doing
:FireEvent("Disable")
:FireEvent("Enable")

Changing transform works for entities that are supposed to move.
Pretty sure this is vanilla behavior, since the windmill blades don't have collision either.

Consider closing

@OrfeasZ OrfeasZ closed this as completed Aug 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants