Sun_and_Moon_Digital
7 months agoMember
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);
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.