Thank you for the response! I did that but for some reason the value stays false, if you can help me it would be really helpful, I’ve been trying to fix this for at least 2 days or 15-20 hours in the editor.
This is the cleaned up and updated code of the spawn_info class:
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }
spawn_info := class(creative_device):
var TeleportNow<public> : logic = false
var Map : int = 0
#Spawns for the map
#MAP: Farm (temporary name)
@editable
Spawns_Farm: []teleporter_device := array{}
OnBegin<override>()<suspends> : void =
loop:
Sleep(1.0)
if (TeleportNow = true):
for (Index -> Player:GetPlayspace().GetPlayers()):
if (Map = 0):
if (Players := Player, Farm := Spawns_Farm[Index]):
Farm.Teleport(Players)
set TeleportNow = false
#This is being called in another class called game_info
TeleportToMap<public>(SelectedMap:int) : void =
set Map = SelectedMap
set TeleportNow = true
Here is the function that calls it after the countdown ends in the game_info class:
StartGame<public>() : void =
Print("Selecting Roles")
SelectRoles()
Print("Selecting Map")
Selection := GetRandomInt(0, 0)
Print("Teleporting the players to the Map")
var info : spawn_info = spawn_info{}
info.TeleportToMap(Selection)
As I said before the value of TeleportNow remains false and doesn’t want to change. Other than that I would want to know what’s the best way to call a variable/function in another class without creating a new instance if that’s possible. Thank you again for the help!