Fixes demon & Giant
This commit is contained in:
5566
Assets/AI/Gigant/Giant.prefab
Normal file
5566
Assets/AI/Gigant/Giant.prefab
Normal file
File diff suppressed because it is too large
Load Diff
7
Assets/AI/Gigant/Giant.prefab.meta
Normal file
7
Assets/AI/Gigant/Giant.prefab.meta
Normal file
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 05db168aa73c6d7489b4930e8ac0f2ce
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
23
Assets/AI/Gigant/LookAtPlayerInitialization.cs
Normal file
23
Assets/AI/Gigant/LookAtPlayerInitialization.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using RootMotion.FinalIK;
|
||||
using UnityEngine;
|
||||
|
||||
public class LookAtPlayerInitialization : MonoBehaviour
|
||||
{
|
||||
public LookAtIK lookAtIK;
|
||||
public string playerTag = "Player";
|
||||
private Transform player;
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
GameObject playerObj = GameObject.FindGameObjectWithTag(playerTag);
|
||||
if (playerObj != null)
|
||||
{
|
||||
player = playerObj.transform;
|
||||
if (lookAtIK != null)
|
||||
{
|
||||
lookAtIK.solver.target = player;
|
||||
lookAtIK.solver.IKPositionWeight = 1f;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Assets/AI/Gigant/LookAtPlayerInitialization.cs.meta
Normal file
2
Assets/AI/Gigant/LookAtPlayerInitialization.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 529e37587f83e4b4893a5814cd0cb915
|
||||
Reference in New Issue
Block a user