I need help with Moving rooms

Hi I want to make something simple for tests, but I don’t know how to do something that was supposed to be easy.



I have a starship with rooms inside and I can walk and control the consoles and all to move the ship.

I haven’t tried this yet but I think it will not work, when the starship moves faster and faster I will start glitching

inside and fall out of the starship.



I have 2 ideas and please tell me could that work and what do you think about it (also do you have any other):

  1. I apply force to player as long with starship so we move at same speed
  2. I make a room somewhere far from the map that doesn’t move and it makes you believe that you are in that starship

    and you can control the ship from that room and when you go out you warp back to the starship :slight_smile:



    I am new to jME so I don’t know will it work and what do I need to do.

Can you not just make the player a node child of the spaceship and make him move relative to the ship instead of relative to the universe?



Your option ( 1 ) is likely to result in very strange behaviour, and calculating the force for your player to move at the same speed as the ship would be a very indirect way of updating his position.

Option ( 2 ) could be executed nicely, but really what you would want is changes in states, not really physically moving around the player. Detach one state ( inside ) and attach the other ( outside ).

@nihal said:
Can you not just make the player a node child of the spaceship and make him move relative to the ship instead of relative to the universe?

Your option ( 1 ) is likely to result in very strange behaviour, and calculating the force for your player to move at the same speed as the ship would be a very indirect way of updating his position.
Option ( 2 ) could be executed nicely, but really what you would want is changes in states, not really physically moving around the player. Detach one state ( inside ) and attach the other ( outside ).

Okay thanks a lot:D
Should I use option 2 or "just make the player a node child of the spaceship".
As I said I am new to jME so how do I make a player a node? I only know about CapsuleCollisionShape, is that a node?

Stop moving the ship. Start moving the world.

@KuroSei said:
Stop moving the ship. Start moving the world.

Yeah, you can adapt the gravity direction dynamically and just move the world / background.

Well, I imagine the two play modes between being inside and being outside the ship are very different, so I would separate them into individual states. This has the advantage that both “worlds” does not have to exist at the same time, which will be more efficient.



Go with option 2, but don’t make a “secret room” far out in space. Use states and make them detachable.



Check this article on states:

https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:advanced:application_states

@KuroSei said:
Stop moving the ship. Start moving the world.

@normen said:
Yeah, you can adapt the gravity direction dynamically and just move the world / background.

Ahh so many possibilites, what do I do?
Can you attach a player node to the ship and move it relatively to it, as @nihal said.
I think it's possible but how do I do it? Can I attach CharacterControl to it?
Or are there other ways to make a player?
@nihal said:
Well, I imagine the two play modes between being inside and being outside the ship are very different, so I would separate them into individual states. This has the advantage that both "worlds" does not have to exist at the same time, which will be more efficient.

Go with option 2, but don't make a "secret room" far out in space. Use states and make them detachable.

Check this article on states:
https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:advanced:application_states

I don't know, I would rather go with this one
@nihal said:
Can you not just make the player a node child of the spaceship and make him move relative to the ship instead of relative to the universe?

But I don't know how to make that player Node. Every time I make a played I use CharacterControl and that is not a spatial nor a node.

https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:scenegraph_for_dummies

@zarch said:
https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:scenegraph_for_dummies

Okay thanks, I know that but can I attach CharacterControl to a node?