- Home /
Player on moving plattform
Hey, I'm currently making a multiplayer game in which one player(fps character controller) navigates a flying ship while the others can run on board of the ship and - for example - shoot with a canoon. The ship has a non kinematic rigidbody attached, so it can collide with other objects. The player who moves the ship gets automatically moved to the position of an emtpy game object on the ship. But the other players who walk on the ship slides down if the ship starts to move or block the ship if it wants to move upwards for example, so it results in strange behaviour of the ship. Anyone got an idea how to solve this problem? Thanks
Try make the players children of the airship? Also, take a look at different collision detection methods on the rigidbodies:
http://unity3d.com/support/documentation/Components/class-Rigidbody.html
Sounds like Continuous or even Continuous Dynamic might help.
Thanks for your answer :) I heard that parenting the players can result in some strange behaviour. I tried this solution but it didn't work. I also tried continuous Dynamic but nothing changed. Or do my player characters also need a rigidbody attached(I'll try it when I'm at home)? Isn't continuous/continuous dynamic bad for the perfomence when many players are on the ship?
How many players do you plan to have?
And for some reason, I presumed you already had rigidbodies on the players. It might be helpful if they have it as well.
$$anonymous$$aybe 10 on one ship, but there will be more than one ship(I use the photon networking engine). Does it work if i set the rigidbodys of the players to kinematic and this use the fps character controller to move them? I don't want to apply physics to them. I'll try it tomorrow because I'm currently not at home.
it does sound like you need to parent your ship to the players. Try making a game object at the lowest level of the hierarchy, then send your players to children of that object.