#Share whole code

1 messages · Page 1 of 1 (latest)

tawny tide
#

Sorry it's taken this long meowsweats

this is literally all the code on an action, the resource is a nested prefab:

{
    ResourceName hotelResourceName = "{C2AEDE3E0F8AE749}Prefabs/HotelRoom/HotelRoom.et";
    
    vector spawnPoint = {2028.595,96.968,1746.197};
    vector pos = {2027.144,96.592,1744.996};
    vector orientation = {0.014,40.533,-0.374};
    
    override void Init(IEntity pOwnerEntity, GenericComponent pManagerComponent)
    {
        
        //spawnParam.TransformMode = ETransformMode.WORLD;
        

        
    }
    
    //------------------------------------------------------------------------------------------------
    override void PerformAction(IEntity pOwnerEntity, IEntity pUserEntity)
    {

        EntitySpawnParams spawnParam = new EntitySpawnParams;
        spawnParam.Transform[3] = pos;
        Resource hotel = Resource.Load(hotelResourceName);
        IEntity hotelEnt = GetGame().SpawnEntityPrefabLocal(hotel, GetGame().GetWorld(), spawnParam);

        Print(hotelEnt);

        SCR_Global.TeleportLocalPlayer(spawnPoint);
    }
    
    override bool HasLocalEffectOnlyScript() { return true; };
    //! If HasLocalEffectOnly() is false this method tells if the server is supposed to broadcast this action to clients.
    override bool CanBroadcastScript() { return false; };
}```
tawny tide
#

I think its only duplicating certain things in the nested prefab actually when spawned thonk

past hinge
#

What wa this about?

tawny tide
#

when I'm spawning the prefab, it's spawning some parts of it twice and at an angle