Weird beeping on Vive Controller when firing haptics programmatically (Unity3D / SteamVR 2.0)
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}
I encountered a weird behavior on Unity when I'm firing haptics on my Vive Wand programmatically on Unity with SteamVR 2.0.
I managed to record it for letting you understand it better: https://www.youtube.com/watch?v=wq4OJUFghNI
Basically, what I did is just a simple shooter, when you pull the trigger, it shoots 3 bullets each second and triggers haptics. The issue is if you release the trigger right just after the haptic code is fired, it sounds like that the controller haptics stays stucked and that you can hear an annoying sound. Retriggering the haptics stops that sound.
I already tried to Google that but looks like nobody experienced it since I didn't find anything. I tried to change the frequency, duration or the intensity given to the function but it doesn't change anything (with a smaller duration, there is a higher chance to not have this behavior, but that's not a fix)
ShootingBehaviour.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Valve.VR;
namespace RG
{
namespace VR
{
public class ShootingBehaviour : MonoBehaviour
{
private bool _IsShooting = false;
private bool _GrabPinchPressed = false;
public GameObject BulletPrefab;
public SteamVR_Action_Vibration HapticAction;
public SteamVR_Action_Boolean GrabPinch;
public SteamVR_Input_Sources InputSource;
private void Start()
{
if (InputSource == SteamVR_Input_Sources.Any)
{
if (CompareTag("LeftController"))
InputSource = SteamVR_Input_Sources.LeftHand;
else if (CompareTag("RightController"))
InputSource = SteamVR_Input_Sources.RightHand;
else
Debug.LogError("Tag on the controller GameObject is incorrect, check again if 'LeftController' or 'RightController' has been assigned.");
}
}
private void Update()
{
if (_GrabPinchPressed)
{
Debug.Log("Trigger is currently pressed");
if (!_IsShooting && GetComponent<InteractableBehaviour>().CurrentlyEquipped)
{
HapticAction.Execute(0, 0.1f, 80, 150, InputSource);
StartCoroutine(_Shoot());
}
}
}
private void OnEnable()
{
if (GrabPinch != null)
GrabPinch.AddOnChangeListener(_OnTriggerPressedOrReleased, InputSource);
}
private void OnDisable()
{
if (GrabPinch != null)
GrabPinch.RemoveOnChangeListener(_OnTriggerPressedOrReleased, InputSource);
}
private void _OnTriggerPressedOrReleased(SteamVR_Action_In action_In)
{
if (GrabPinch.GetStateDown(InputSource))
_GrabPinchPressed = true;
else if (GrabPinch.GetStateUp(InputSource))
_GrabPinchPressed = false;
}
private IEnumerator _Shoot()
{
_IsShooting = true;
GameObject weapon = GetComponent<InteractableBehaviour>().CurrentlyEquipped;
GameObject bullet = Instantiate(BulletPrefab, weapon.transform.Find("BulletStartPos"));
bullet.transform.SetParent(null);
bullet.GetComponent<Rigidbody>().AddForce(bullet.transform.forward * 300);
yield return new WaitForSeconds(0.3f);
_IsShooting = false;
}
}
}
}
InteractableBehaviour is just storing the weapon in hand, showing it there would not really help or anything.
The HapticAction.Execute here is correctly triggering haptics but looks like something is glitching up the haptics sometimes for some reasons. Does someone have an idea why it is doing that?
c# unity3d htc-vive steamvr
add a comment |
I encountered a weird behavior on Unity when I'm firing haptics on my Vive Wand programmatically on Unity with SteamVR 2.0.
I managed to record it for letting you understand it better: https://www.youtube.com/watch?v=wq4OJUFghNI
Basically, what I did is just a simple shooter, when you pull the trigger, it shoots 3 bullets each second and triggers haptics. The issue is if you release the trigger right just after the haptic code is fired, it sounds like that the controller haptics stays stucked and that you can hear an annoying sound. Retriggering the haptics stops that sound.
I already tried to Google that but looks like nobody experienced it since I didn't find anything. I tried to change the frequency, duration or the intensity given to the function but it doesn't change anything (with a smaller duration, there is a higher chance to not have this behavior, but that's not a fix)
ShootingBehaviour.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Valve.VR;
namespace RG
{
namespace VR
{
public class ShootingBehaviour : MonoBehaviour
{
private bool _IsShooting = false;
private bool _GrabPinchPressed = false;
public GameObject BulletPrefab;
public SteamVR_Action_Vibration HapticAction;
public SteamVR_Action_Boolean GrabPinch;
public SteamVR_Input_Sources InputSource;
private void Start()
{
if (InputSource == SteamVR_Input_Sources.Any)
{
if (CompareTag("LeftController"))
InputSource = SteamVR_Input_Sources.LeftHand;
else if (CompareTag("RightController"))
InputSource = SteamVR_Input_Sources.RightHand;
else
Debug.LogError("Tag on the controller GameObject is incorrect, check again if 'LeftController' or 'RightController' has been assigned.");
}
}
private void Update()
{
if (_GrabPinchPressed)
{
Debug.Log("Trigger is currently pressed");
if (!_IsShooting && GetComponent<InteractableBehaviour>().CurrentlyEquipped)
{
HapticAction.Execute(0, 0.1f, 80, 150, InputSource);
StartCoroutine(_Shoot());
}
}
}
private void OnEnable()
{
if (GrabPinch != null)
GrabPinch.AddOnChangeListener(_OnTriggerPressedOrReleased, InputSource);
}
private void OnDisable()
{
if (GrabPinch != null)
GrabPinch.RemoveOnChangeListener(_OnTriggerPressedOrReleased, InputSource);
}
private void _OnTriggerPressedOrReleased(SteamVR_Action_In action_In)
{
if (GrabPinch.GetStateDown(InputSource))
_GrabPinchPressed = true;
else if (GrabPinch.GetStateUp(InputSource))
_GrabPinchPressed = false;
}
private IEnumerator _Shoot()
{
_IsShooting = true;
GameObject weapon = GetComponent<InteractableBehaviour>().CurrentlyEquipped;
GameObject bullet = Instantiate(BulletPrefab, weapon.transform.Find("BulletStartPos"));
bullet.transform.SetParent(null);
bullet.GetComponent<Rigidbody>().AddForce(bullet.transform.forward * 300);
yield return new WaitForSeconds(0.3f);
_IsShooting = false;
}
}
}
}
InteractableBehaviour is just storing the weapon in hand, showing it there would not really help or anything.
The HapticAction.Execute here is correctly triggering haptics but looks like something is glitching up the haptics sometimes for some reasons. Does someone have an idea why it is doing that?
c# unity3d htc-vive steamvr
what is in that_Shoot()coroutine? / Where is_IsShootingset? Also note that callingGetComponent<InteractableBehaviour>()is quite inefficient and you should rather do it e.g. inAwakeand store the result for later
– derHugo
Jan 4 at 12:19
Also there I didn't findHapticActionin the SteamVr sdk so if this is something you implemeted .. could you add this as well please?
– derHugo
Jan 4 at 12:24
I found however the SteamVR_Action_Vibration if you mean that one. There it says for the third parameter"amplitude">How intense the haptic action should be (0 - 1)you are calling it with150... ?
– derHugo
Jan 4 at 12:32
I edited my question and added the wholeShootingBehaviour.csfile just "to be sure" nothing is missing, but I don't think it will help anything since the shooting behavior is working, what's not is just the haptics one. Not gonna linkInteractableBehaviour.csfor about the same reasons I mentioned. TheHapticAction.Executeis not a function of mine and is part of SteamVR 2.0 by the way (EDIT: oops yeah because it was aSteamVR_Action_Vibration)
– Shoko84
Jan 4 at 12:33
I just tried changing theamplitudeparameter and it doesn't change anything (tried 1, 0.2f and 0). That's a bit weird because I don't see any difference between 1 and 0.2f. 0 doesn't fire haptics, which is normal
– Shoko84
Jan 4 at 12:41
add a comment |
I encountered a weird behavior on Unity when I'm firing haptics on my Vive Wand programmatically on Unity with SteamVR 2.0.
I managed to record it for letting you understand it better: https://www.youtube.com/watch?v=wq4OJUFghNI
Basically, what I did is just a simple shooter, when you pull the trigger, it shoots 3 bullets each second and triggers haptics. The issue is if you release the trigger right just after the haptic code is fired, it sounds like that the controller haptics stays stucked and that you can hear an annoying sound. Retriggering the haptics stops that sound.
I already tried to Google that but looks like nobody experienced it since I didn't find anything. I tried to change the frequency, duration or the intensity given to the function but it doesn't change anything (with a smaller duration, there is a higher chance to not have this behavior, but that's not a fix)
ShootingBehaviour.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Valve.VR;
namespace RG
{
namespace VR
{
public class ShootingBehaviour : MonoBehaviour
{
private bool _IsShooting = false;
private bool _GrabPinchPressed = false;
public GameObject BulletPrefab;
public SteamVR_Action_Vibration HapticAction;
public SteamVR_Action_Boolean GrabPinch;
public SteamVR_Input_Sources InputSource;
private void Start()
{
if (InputSource == SteamVR_Input_Sources.Any)
{
if (CompareTag("LeftController"))
InputSource = SteamVR_Input_Sources.LeftHand;
else if (CompareTag("RightController"))
InputSource = SteamVR_Input_Sources.RightHand;
else
Debug.LogError("Tag on the controller GameObject is incorrect, check again if 'LeftController' or 'RightController' has been assigned.");
}
}
private void Update()
{
if (_GrabPinchPressed)
{
Debug.Log("Trigger is currently pressed");
if (!_IsShooting && GetComponent<InteractableBehaviour>().CurrentlyEquipped)
{
HapticAction.Execute(0, 0.1f, 80, 150, InputSource);
StartCoroutine(_Shoot());
}
}
}
private void OnEnable()
{
if (GrabPinch != null)
GrabPinch.AddOnChangeListener(_OnTriggerPressedOrReleased, InputSource);
}
private void OnDisable()
{
if (GrabPinch != null)
GrabPinch.RemoveOnChangeListener(_OnTriggerPressedOrReleased, InputSource);
}
private void _OnTriggerPressedOrReleased(SteamVR_Action_In action_In)
{
if (GrabPinch.GetStateDown(InputSource))
_GrabPinchPressed = true;
else if (GrabPinch.GetStateUp(InputSource))
_GrabPinchPressed = false;
}
private IEnumerator _Shoot()
{
_IsShooting = true;
GameObject weapon = GetComponent<InteractableBehaviour>().CurrentlyEquipped;
GameObject bullet = Instantiate(BulletPrefab, weapon.transform.Find("BulletStartPos"));
bullet.transform.SetParent(null);
bullet.GetComponent<Rigidbody>().AddForce(bullet.transform.forward * 300);
yield return new WaitForSeconds(0.3f);
_IsShooting = false;
}
}
}
}
InteractableBehaviour is just storing the weapon in hand, showing it there would not really help or anything.
The HapticAction.Execute here is correctly triggering haptics but looks like something is glitching up the haptics sometimes for some reasons. Does someone have an idea why it is doing that?
c# unity3d htc-vive steamvr
I encountered a weird behavior on Unity when I'm firing haptics on my Vive Wand programmatically on Unity with SteamVR 2.0.
I managed to record it for letting you understand it better: https://www.youtube.com/watch?v=wq4OJUFghNI
Basically, what I did is just a simple shooter, when you pull the trigger, it shoots 3 bullets each second and triggers haptics. The issue is if you release the trigger right just after the haptic code is fired, it sounds like that the controller haptics stays stucked and that you can hear an annoying sound. Retriggering the haptics stops that sound.
I already tried to Google that but looks like nobody experienced it since I didn't find anything. I tried to change the frequency, duration or the intensity given to the function but it doesn't change anything (with a smaller duration, there is a higher chance to not have this behavior, but that's not a fix)
ShootingBehaviour.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Valve.VR;
namespace RG
{
namespace VR
{
public class ShootingBehaviour : MonoBehaviour
{
private bool _IsShooting = false;
private bool _GrabPinchPressed = false;
public GameObject BulletPrefab;
public SteamVR_Action_Vibration HapticAction;
public SteamVR_Action_Boolean GrabPinch;
public SteamVR_Input_Sources InputSource;
private void Start()
{
if (InputSource == SteamVR_Input_Sources.Any)
{
if (CompareTag("LeftController"))
InputSource = SteamVR_Input_Sources.LeftHand;
else if (CompareTag("RightController"))
InputSource = SteamVR_Input_Sources.RightHand;
else
Debug.LogError("Tag on the controller GameObject is incorrect, check again if 'LeftController' or 'RightController' has been assigned.");
}
}
private void Update()
{
if (_GrabPinchPressed)
{
Debug.Log("Trigger is currently pressed");
if (!_IsShooting && GetComponent<InteractableBehaviour>().CurrentlyEquipped)
{
HapticAction.Execute(0, 0.1f, 80, 150, InputSource);
StartCoroutine(_Shoot());
}
}
}
private void OnEnable()
{
if (GrabPinch != null)
GrabPinch.AddOnChangeListener(_OnTriggerPressedOrReleased, InputSource);
}
private void OnDisable()
{
if (GrabPinch != null)
GrabPinch.RemoveOnChangeListener(_OnTriggerPressedOrReleased, InputSource);
}
private void _OnTriggerPressedOrReleased(SteamVR_Action_In action_In)
{
if (GrabPinch.GetStateDown(InputSource))
_GrabPinchPressed = true;
else if (GrabPinch.GetStateUp(InputSource))
_GrabPinchPressed = false;
}
private IEnumerator _Shoot()
{
_IsShooting = true;
GameObject weapon = GetComponent<InteractableBehaviour>().CurrentlyEquipped;
GameObject bullet = Instantiate(BulletPrefab, weapon.transform.Find("BulletStartPos"));
bullet.transform.SetParent(null);
bullet.GetComponent<Rigidbody>().AddForce(bullet.transform.forward * 300);
yield return new WaitForSeconds(0.3f);
_IsShooting = false;
}
}
}
}
InteractableBehaviour is just storing the weapon in hand, showing it there would not really help or anything.
The HapticAction.Execute here is correctly triggering haptics but looks like something is glitching up the haptics sometimes for some reasons. Does someone have an idea why it is doing that?
c# unity3d htc-vive steamvr
c# unity3d htc-vive steamvr
edited Jan 4 at 12:28
Shoko84
asked Jan 4 at 12:01
Shoko84Shoko84
62
62
what is in that_Shoot()coroutine? / Where is_IsShootingset? Also note that callingGetComponent<InteractableBehaviour>()is quite inefficient and you should rather do it e.g. inAwakeand store the result for later
– derHugo
Jan 4 at 12:19
Also there I didn't findHapticActionin the SteamVr sdk so if this is something you implemeted .. could you add this as well please?
– derHugo
Jan 4 at 12:24
I found however the SteamVR_Action_Vibration if you mean that one. There it says for the third parameter"amplitude">How intense the haptic action should be (0 - 1)you are calling it with150... ?
– derHugo
Jan 4 at 12:32
I edited my question and added the wholeShootingBehaviour.csfile just "to be sure" nothing is missing, but I don't think it will help anything since the shooting behavior is working, what's not is just the haptics one. Not gonna linkInteractableBehaviour.csfor about the same reasons I mentioned. TheHapticAction.Executeis not a function of mine and is part of SteamVR 2.0 by the way (EDIT: oops yeah because it was aSteamVR_Action_Vibration)
– Shoko84
Jan 4 at 12:33
I just tried changing theamplitudeparameter and it doesn't change anything (tried 1, 0.2f and 0). That's a bit weird because I don't see any difference between 1 and 0.2f. 0 doesn't fire haptics, which is normal
– Shoko84
Jan 4 at 12:41
add a comment |
what is in that_Shoot()coroutine? / Where is_IsShootingset? Also note that callingGetComponent<InteractableBehaviour>()is quite inefficient and you should rather do it e.g. inAwakeand store the result for later
– derHugo
Jan 4 at 12:19
Also there I didn't findHapticActionin the SteamVr sdk so if this is something you implemeted .. could you add this as well please?
– derHugo
Jan 4 at 12:24
I found however the SteamVR_Action_Vibration if you mean that one. There it says for the third parameter"amplitude">How intense the haptic action should be (0 - 1)you are calling it with150... ?
– derHugo
Jan 4 at 12:32
I edited my question and added the wholeShootingBehaviour.csfile just "to be sure" nothing is missing, but I don't think it will help anything since the shooting behavior is working, what's not is just the haptics one. Not gonna linkInteractableBehaviour.csfor about the same reasons I mentioned. TheHapticAction.Executeis not a function of mine and is part of SteamVR 2.0 by the way (EDIT: oops yeah because it was aSteamVR_Action_Vibration)
– Shoko84
Jan 4 at 12:33
I just tried changing theamplitudeparameter and it doesn't change anything (tried 1, 0.2f and 0). That's a bit weird because I don't see any difference between 1 and 0.2f. 0 doesn't fire haptics, which is normal
– Shoko84
Jan 4 at 12:41
what is in that
_Shoot() coroutine? / Where is _IsShooting set? Also note that calling GetComponent<InteractableBehaviour>() is quite inefficient and you should rather do it e.g. in Awake and store the result for later– derHugo
Jan 4 at 12:19
what is in that
_Shoot() coroutine? / Where is _IsShooting set? Also note that calling GetComponent<InteractableBehaviour>() is quite inefficient and you should rather do it e.g. in Awake and store the result for later– derHugo
Jan 4 at 12:19
Also there I didn't find
HapticAction in the SteamVr sdk so if this is something you implemeted .. could you add this as well please?– derHugo
Jan 4 at 12:24
Also there I didn't find
HapticAction in the SteamVr sdk so if this is something you implemeted .. could you add this as well please?– derHugo
Jan 4 at 12:24
I found however the SteamVR_Action_Vibration if you mean that one. There it says for the third parameter
"amplitude">How intense the haptic action should be (0 - 1) you are calling it with 150 ... ?– derHugo
Jan 4 at 12:32
I found however the SteamVR_Action_Vibration if you mean that one. There it says for the third parameter
"amplitude">How intense the haptic action should be (0 - 1) you are calling it with 150 ... ?– derHugo
Jan 4 at 12:32
I edited my question and added the whole
ShootingBehaviour.cs file just "to be sure" nothing is missing, but I don't think it will help anything since the shooting behavior is working, what's not is just the haptics one. Not gonna link InteractableBehaviour.cs for about the same reasons I mentioned. The HapticAction.Execute is not a function of mine and is part of SteamVR 2.0 by the way (EDIT: oops yeah because it was a SteamVR_Action_Vibration)– Shoko84
Jan 4 at 12:33
I edited my question and added the whole
ShootingBehaviour.cs file just "to be sure" nothing is missing, but I don't think it will help anything since the shooting behavior is working, what's not is just the haptics one. Not gonna link InteractableBehaviour.cs for about the same reasons I mentioned. The HapticAction.Execute is not a function of mine and is part of SteamVR 2.0 by the way (EDIT: oops yeah because it was a SteamVR_Action_Vibration)– Shoko84
Jan 4 at 12:33
I just tried changing the
amplitude parameter and it doesn't change anything (tried 1, 0.2f and 0). That's a bit weird because I don't see any difference between 1 and 0.2f. 0 doesn't fire haptics, which is normal– Shoko84
Jan 4 at 12:41
I just tried changing the
amplitude parameter and it doesn't change anything (tried 1, 0.2f and 0). That's a bit weird because I don't see any difference between 1 and 0.2f. 0 doesn't fire haptics, which is normal– Shoko84
Jan 4 at 12:41
add a comment |
1 Answer
1
active
oldest
votes
Like Shoko84 states the amplitude parameter makes no difference.
In fact none of the parameters seem to make any difference in calling HapticAction.Execute
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54038599%2fweird-beeping-on-vive-controller-when-firing-haptics-programmatically-unity3d%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Like Shoko84 states the amplitude parameter makes no difference.
In fact none of the parameters seem to make any difference in calling HapticAction.Execute
add a comment |
Like Shoko84 states the amplitude parameter makes no difference.
In fact none of the parameters seem to make any difference in calling HapticAction.Execute
add a comment |
Like Shoko84 states the amplitude parameter makes no difference.
In fact none of the parameters seem to make any difference in calling HapticAction.Execute
Like Shoko84 states the amplitude parameter makes no difference.
In fact none of the parameters seem to make any difference in calling HapticAction.Execute
answered Jan 22 at 18:02
Charl CillieCharl Cillie
32
32
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54038599%2fweird-beeping-on-vive-controller-when-firing-haptics-programmatically-unity3d%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
what is in that
_Shoot()coroutine? / Where is_IsShootingset? Also note that callingGetComponent<InteractableBehaviour>()is quite inefficient and you should rather do it e.g. inAwakeand store the result for later– derHugo
Jan 4 at 12:19
Also there I didn't find
HapticActionin the SteamVr sdk so if this is something you implemeted .. could you add this as well please?– derHugo
Jan 4 at 12:24
I found however the SteamVR_Action_Vibration if you mean that one. There it says for the third parameter
"amplitude">How intense the haptic action should be (0 - 1)you are calling it with150... ?– derHugo
Jan 4 at 12:32
I edited my question and added the whole
ShootingBehaviour.csfile just "to be sure" nothing is missing, but I don't think it will help anything since the shooting behavior is working, what's not is just the haptics one. Not gonna linkInteractableBehaviour.csfor about the same reasons I mentioned. TheHapticAction.Executeis not a function of mine and is part of SteamVR 2.0 by the way (EDIT: oops yeah because it was aSteamVR_Action_Vibration)– Shoko84
Jan 4 at 12:33
I just tried changing the
amplitudeparameter and it doesn't change anything (tried 1, 0.2f and 0). That's a bit weird because I don't see any difference between 1 and 0.2f. 0 doesn't fire haptics, which is normal– Shoko84
Jan 4 at 12:41