Forum Discussion

Sun_and_Moon_Digital's avatar
7 months ago
Solved

Teleport Visual Anomaly

I have a script that teleports a player from a trigger point to a spawn point. The teleporting works but there is a large black circle that shows up on the right until I get to the spawn point and then it disappears. 

import { Entity, Component, PropTypes, CodeBlockEvents, SpawnPointGizmo, Player } from 'horizon/core';

class TeleportPlayer extends Component<typeof TeleportPlayer> {
  static propsDefinition = {
    spawnPoint: { type: PropTypes.Entity } // The spawn point entity to teleport to
  };

  start() {
    // Check if the spawn point entity is valid
    if (!this.props.spawnPoint!) {
      console.error('Spawn point entity is not set');
      return;
    }

    // Cast the spawn point entity to a SpawnPointGizmo to access its teleportPlayer method
    const spawnPointGizmo = this.props.spawnPoint!.as(SpawnPointGizmo)!;
    if (!spawnPointGizmo) {
      console.error('Spawn point entity is not a SpawnPointGizmo');
      return;
    }

    // Connect to the OnPlayerEnterTrigger event to teleport players to the spawn point
    this.connectCodeBlockEvent(this.entity, CodeBlockEvents.OnPlayerEnterTrigger, (player: Player) => {
      // Teleport the player to the spawn point
      spawnPointGizmo.teleportPlayer(player);
    });
  }
}

// Register the TeleportPlayer component
Component.register(TeleportPlayer);
  • SeeingBlue's avatar
    SeeingBlue
    7 months ago

    The expectation for teleporting a player is that the player experiences a short black screen during the transition period. It sounds like your POV is outside of that screen somehow. Sounds like a visual bug.

3 Replies

  • Update: I noticed two things, if I turn my head to the right the black circle fills my vision, if I turn my head to the left I can not see the black circle.

    • SeeingBlue's avatar
      SeeingBlue
      Mentor

      The expectation for teleporting a player is that the player experiences a short black screen during the transition period. It sounds like your POV is outside of that screen somehow. Sounds like a visual bug.