Search Unity

Question Scripting issues

Discussion in 'Getting Started' started by johnwoods_328, Feb 9, 2024.

  1. johnwoods_328

    johnwoods_328

    Joined:
    Dec 17, 2023
    Posts:
    8
    I’m trying to create a simple teleporter using the event onplayertriggerenter, the graph is definitely set up right but when I enter the portal aka trigger the collider it crashes out of play mode and says the the object is being destroyed Use destroy instead of destroy immediately I’m lost and the problem seems nonsensical
     
  2. spiney199

    spiney199

    Joined:
    Feb 11, 2021
    Posts:
    7,889
    More information is needed here. You say "the graph is set up right", are you using Visual Scripting? Or is this via code/the inspector? If so, we'd need to see the code and examples of the set up, along with what line of code the error is occuring on.

    If you are posting code, please make sure to use code-tags: https://forum.unity.com/threads/using-code-tags-properly.143875/
     
  3. johnwoods_328

    johnwoods_328

    Joined:
    Dec 17, 2023
    Posts:
    8
    Ok hold on one sec
     
  4. johnwoods_328

    johnwoods_328

    Joined:
    Dec 17, 2023
    Posts:
    8
    This is via udon visual graph
     
  5. spiney199

    spiney199

    Joined:
    Feb 11, 2021
    Posts:
    7,889
    Is this a VR chat thing? Do they have their own support forums/Discord?
     
  6. johnwoods_328

    johnwoods_328

    Joined:
    Dec 17, 2023
    Posts:
    8
    .data_start

    .export newVariable

    __instance_0: %VRCSDKBaseVRCPlayerApi, null
    __teleportPos_0: %UnityEngineVector3, null
    __teleportRot_0: %UnityEngineQuaternion, null
    __instance_1: %UnityEngineTransform, this
    __instance_2: %UnityEngineTransform, this
    newVariable: %UnityEngineTransform, this

    .data_end

    .code_start

    .export _interact

    _interact:

    PUSH, __instance_0
    EXTERN, "VRCSDKBaseNetworking.__get_LocalPlayer__VRCSDKBaseVRCPlayerApi"
    PUSH, newVariable
    PUSH, __instance_1
    COPY
    PUSH, __instance_1
    PUSH, __teleportPos_0
    EXTERN, "UnityEngineTransform.__get_position__UnityEngineVector3"
    PUSH, newVariable
    PUSH, __instance_2
    COPY
    PUSH, __instance_2
    PUSH, __teleportRot_0
    EXTERN, "UnityEngineTransform.__get_rotation__UnityEngineQuaternion"
    PUSH, __instance_0
    PUSH, __teleportPos_0
    PUSH, __teleportRot_0
    EXTERN, "VRCSDKBaseVRCPlayerApi.__TeleportTo__UnityEngineVector3_UnityEngineQuaternion__SystemVoid"
    JUMP, 0xFFFFFFFC


    .code_end
     
  7. johnwoods_328

    johnwoods_328

    Joined:
    Dec 17, 2023
    Posts:
    8
    Yes it is a vr chat world
     
  8. johnwoods_328

    johnwoods_328

    Joined:
    Dec 17, 2023
    Posts:
    8
    I don’t know if they will be as quick to respond
     
  9. johnwoods_328

    johnwoods_328

    Joined:
    Dec 17, 2023
    Posts:
    8
    I can set the instance of the teleport function to get local player and the event to interact and the teleport works but I want it to be when the player passes through the box and that is with the event onplayertriggerenter
     
  10. johnwoods_328

    johnwoods_328

    Joined:
    Dec 17, 2023
    Posts:
    8
    If you know anything or someone who can help I’m really held up rn by it