#Spaceship movement causes player to twitch up and down

1 messages · Page 1 of 1 (latest)

left rapids
#

I have a 3D spaceship object with a player inside. Both have Rigidbodies + colliders attached. However, when the spaceship moves "up" (meaning the floor beneath the player goes up), it causes the player to twitch up and down. I've tried to play around with the Rigidbody settings but I can't seem to resolve the issue. Any ideas are appreciated.

gritty trench
left rapids
#

The player does need to move unfortunately, the game is multiplayer so whilst the pilot's rigidbody could be disabled, the rest of the players in the ship must be able to move around even during ship manoeuvrers.

karmic phoenix
#

Show code

left rapids
#

I don't think the issue is the code, though I'll be happy to share. Which scripts do you want to see?

#

Script that makes player group object have the same position and rotation as spaceship (Players of the ship are parented under this object so they can rotate and move with the ship):

using System.Collections.Generic;
using UnityEngine;

public class PlayersFollowShip : MonoBehaviour
{
    [SerializeField] private GameObject playerGroup;

    void Update()
    {
        // Setting position of player group
        playerGroup.transform.position = transform.position;
        // Rotating player group
        playerGroup.transform.eulerAngles = transform.eulerAngles;
    }
}```