1
0
forked from cgvr/DeltaVR

fix bug with player colliding with spawned model when holding it

This commit is contained in:
2026-01-27 17:50:13 +02:00
parent 15b92e92b4
commit 77fc43bebd
4 changed files with 36 additions and 9 deletions

View File

@@ -90,6 +90,7 @@ GameObject:
- component: {fileID: 584286906844083765}
- component: {fileID: 6105090838799004608}
- component: {fileID: 6238040606326453210}
- component: {fileID: 7699707098595015193}
- component: {fileID: 1155083335105893391}
- component: {fileID: 1413215456818694348}
- component: {fileID: 483845010817450077}
@@ -165,7 +166,7 @@ MonoBehaviour:
m_FallbackScreenDPI: 96
m_DefaultSpriteDPI: 96
m_DynamicPixelsPerUnit: 1
m_PresetInfoIsWorld: 0
m_PresetInfoIsWorld: 1
--- !u!114 &6105090838799004608
MonoBehaviour:
m_ObjectHideFlags: 0
@@ -198,6 +199,31 @@ MonoBehaviour:
mouthTransform: {fileID: 5759406807219530703}
mouthScalingMultiplier: 2.5
mouthMovementDuration: 0.25
voiceLineKeys: []
--- !u!114 &7699707098595015193
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4663194936290788516}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 6c6205a218222364ca440c740b7a6b8f, type: 3}
m_Name:
m_EditorClassIdentifier:
SelectAudio:
Guid:
Data1: 0
Data2: 0
Data3: 0
Data4: 0
Path:
SoundOcclusionWidening: 1
PlayerOcclusionWidening: 1
OcclusionLayer:
serializedVersion: 2
m_Bits: 0
--- !u!135 &1155083335105893391
SphereCollider:
m_ObjectHideFlags: 0

View File

@@ -1,9 +1,6 @@
using FishNet.Component.Transforming;
using FishNet.Object;
using System;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.XR.Interaction.Toolkit;
public class ShapeDetectionMinigameController : MonoBehaviour
{
@@ -16,6 +13,7 @@ public class ShapeDetectionMinigameController : MonoBehaviour
public GameObject GeneratedModel { get; private set; }
public Transform modelSpawnPoint;
public string shapeScannerTag = "ShapeScannable";
public int ignorePlayerCollisionLayer = 2;
private bool modelGenerationInProgress;
@@ -70,6 +68,7 @@ public class ShapeDetectionMinigameController : MonoBehaviour
GameObject spawnedObjectParent = new GameObject("SpawnedModelParent");
spawnedObjectParent.transform.parent = modelSpawnPoint;
spawnedObjectParent.transform.position = modelSpawnPoint.transform.position;
spawnedObjectParent.layer = ignorePlayerCollisionLayer;
Rigidbody rigidbody = spawnedObjectParent.AddComponent<Rigidbody>();
rigidbody.isKinematic = true;
@@ -81,6 +80,7 @@ public class ShapeDetectionMinigameController : MonoBehaviour
spawnedObject.transform.parent = spawnedObjectParent.transform;
spawnedObject.transform.position = spawnedObjectParent.transform.position;
spawnedObject.tag = shapeScannerTag;
spawnedObject.layer = ignorePlayerCollisionLayer;
spawnedObjectParent.AddComponent<TwoHandScaleGrabInteractable>();
}