cancel
Showing results for 
Search instead for 
Did you mean: 

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);
1 ACCEPTED SOLUTION

Accepted Solutions

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.

Upcoming Events:
Performance Pro - UI Unleashed - Building Responsive & Performant Interfaces Thursday June 19th 5:00 PM PT - Register
June Programming Calendar

View solution in original post

3 REPLIES 3

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.

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.

Upcoming Events:
Performance Pro - UI Unleashed - Building Responsive & Performant Interfaces Thursday June 19th 5:00 PM PT - Register
June Programming Calendar

Ok thx, I'll report it as a bug.