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

How to move the Entity in the world, without using physical system? #58

Closed
qlang122 opened this issue Jun 30, 2021 · 4 comments
Closed
Labels
need more info Further information is requested or not clear question

Comments

@qlang122
Copy link

in demo, it use the 'Physics Body' to move the player. if i don't open Physics enable, and want to move player.
how can id do?

Direct manipulation of transformcomponent's coordinates does not work. because CompositeSystem is constantly updating it.

@fgnm
Copy link
Member

fgnm commented Jun 30, 2021

Hi, currently physics bodies connot be placed inside composites (I don't know if this will ever be possible in future becuase the problem is more conceptual.. What should happens if other objects that aren't physics?). I think that physics inside composite doesn't make much sense, but if you've suggestions please share :)

Regarding coordinates you can move any type of object by changing values in TransformComponent. Remeber that coordinates are local to the composite size and position, CompositeSystem does the expected behavior as it have to update position relative to parent composite.

@fgnm fgnm added the need more info Further information is requested or not clear question label Jul 1, 2021
@qlang122
Copy link
Author

qlang122 commented Jul 1, 2021

i got it. although I didn't enable Physics. but I created the Physics composites. so PhysicsSystem will still update it.

also, it can't be use PerspectiveCamera for perspective effect? similar to the effect of 2.5D game. or can i how to use OrthographicCamera make it.

@fgnm
Copy link
Member

fgnm commented Jul 1, 2021

Yes PhysicsSystem will always update bodies and their position, if you need a custom behavior the best way is to override this system like this one made for the editor PhysicsAdjustSystem.

Regarding camera, in theory you can use a PerspectiveCamera at runtime, but current runtime implementation doesn't support anything related to a 3d environment (z axis), you might have to struggle a bit with the sprite batch to get some results... I'd like to add a PerspectiveCamera with more 2.5D effects but this is a very far feature.. there are still lot of 2D stuff that have to me done first

@qlang122
Copy link
Author

qlang122 commented Jul 2, 2021

Well, thank you very much.

@qlang122 qlang122 closed this as completed Jul 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need more info Further information is requested or not clear question
Projects
None yet
Development

No branches or pull requests

2 participants