NoPoints pretty much working

This commit is contained in:
2025-11-27 01:27:15 +00:00
parent 6902bde37d
commit 2aab039a08
424 changed files with 89071 additions and 2340 deletions

View File

@@ -0,0 +1,44 @@

using UdonSharp;
using UnityEngine;
using VRC.SDK3.Components;
using VRC.SDKBase;
using VRC.Udon;
public class TabletManager : UdonSharpBehaviour
{
[SerializeField] private GameObject tablet;
[SerializeField] private float spawnDistance = 2f;
[SerializeField] private float spawnHeight = 1f;
[SerializeField] private VRCPickup tabletPickup;
private void Start()
{
if (!Networking.IsOwner(gameObject))
{
Destroy(tabletPickup);
}
}
private void Update()
{
if (Input.GetKeyDown(KeyCode.T) && Networking.IsOwner(gameObject))
{
SpawnTablet();
}
}
private void SpawnTablet()
{
// Get local player's position and rotation
VRCPlayerApi localPlayer = Networking.LocalPlayer;
if (localPlayer == null || tablet == null) return;
Vector3 spawnPos = localPlayer.GetPosition() + (localPlayer.GetRotation() * Vector3.forward) * spawnDistance + Vector3.up * spawnHeight;
Quaternion spawnRot = localPlayer.GetRotation();
tablet.transform.position = spawnPos;
tablet.transform.rotation = spawnRot;
}
}