Hey
there is a problem with my game. Its a unity physics / scripting problem. My player falls really slow. Its because of the script but how can i move my player then?
{
public GameObject playerlight;
public GameObject playerdark;
public Joystick PlayerMovementJoystick;
public Rigidbody2D playerDarkRigidbody;
public Rigidbody2D playerLightRigidbody;
public float movespeed;
public Transform playerLightpos;
public Transform playerDarkpos;
public float jumpforce;
private void Start()
{
playerlight = GameObject.Find("PlayerLight");
playerdark = GameObject.Find("PlayerDark");
}
public void SwitchPlayerS()
{
}
private void Update()
{ if(GamaDataManagerScript.LightOn == true)
{
Vector3 playermovementvec = new Vector3(PlayerMovementJoystick.Horizontal * Time.deltaTime * movespeed, 0, 0);
playerLightRigidbody.MovePosition(playermovementvec + playerLightpos.position);
}
else
{
Vector3 playermovementvecdark = new Vector3(PlayerMovementJoystick.Horizontal * Time.deltaTime * movespeed, 0, 0);
playerDarkRigidbody.MovePosition(playermovementvecdark + playerDarkpos.position);
}
}
public void Jump()
{
if(GamaDataManagerScript.LightOn == true)
{
playerLightRigidbody.velocity.Set(playerLightRigidbody.velocity.x, playerLightRigidbody.velocity.y + jumpforce);
}
}
}