I am trying to get the Apple Core Haptics plug-in to work with Unity but am having issues when I try to build the project.
I created a completely blank project with just the Core and CoreHaptics plug-ins installed. I then put in a single script (below) which is a replication of the script shared in the WWDC22 video on this subject.
Then when I try to build and run that project I get a series of “Undefined symbol:” errors in Xcode. These effect the CoreHaptics, UIFeedbackGenerator frameworks.
If I remove the script and just build an empty project with Core and CoreHaptics installed the build runs successfully. What am I doing wrong or missing that is causing these errors?
using Apple.CoreHaptics;
using System.Collections;
using UnityEngine;
public class Haptics : MonoBehaviour
{
private CHHapticEngine _hapticEngine;
private CHHapticPatternPlayer _hapticPlayer;
[SerializeField] private AHAPAsset _hapticAsset;
private void PrepareHaptics()
{
_hapticEngine = new CHHapticEngine();
_hapticEngine.Start();
_hapticPlayer = _hapticEngine.MakePlayer(_hapticAsset.GetPattern());
}
private void Play()
{
_hapticPlayer.Start();
}
}