Is there a chance that Play On Awake on an AudioSource doesn’t work in iOS Quicklook?
br,
Max
Is there a chance that Play On Awake on an AudioSource doesn’t work in iOS Quicklook?
br,
Max
Hi Max,
Yes, there is a chance that “Play on Awake” for an AudioSource doesn’t work in iOS Quicklook. It appears that due to a regression in QuickLook, audio sources that are set to play on tap cannot also auto-play at scene start. The current workaround is to ensure that there is a tap action in the scene, as this action seems to be necessary for the audio to play properly on iOS devices (see the documentation).
If you have more specific scenarios or additional questions, feel free to ask!
Best regards.
1 replies left - Get a PRO license for more AI replies.
thread_GoXbtpI4bZ7ltaP5F35OgpY2
Reply to this message to continue the conversation
Tell me how to setup a tap action for my scene, to play audio source on iOS Quicklook.
Hi Max,
To set up a tap action in your scene to play an audio source in iOS Quicklook, follow these steps:
Create a Tap Action Component: This component will detect user input.
Add the Audio Source Component: Ensure that your AudioSource is set up properly in your scene.
Link the Tap Action to the Audio Source: On your tap action, set it to trigger the audio playback when a tap is detected.
Here’s a pseudocode outline of the implementation:
import { TapAction } from "@needle-tools/engine"; // Import necessary components
import { AudioSource } from "@needle-tools/engine"; // Import AudioSource
// Create a TapAction component
const tapAction = new TapAction();
tapAction.onTap(() => {
const audioSource = getComponent(AudioSource); // Get the audio source component
if (audioSource) {
audioSource.play(); // Play the audio on tap
}
});
// Attach the tap action to a game object
const gameObject = createGameObject();
gameObject.addComponent(tapAction);
Create a Game Object in your scene to handle taps.
Add the TapAction
Component to that game object.
Add the AudioSource
Component to the same or another relevant game object.
Ensure the environment supports the TapAction
. Test it in the iOS Quicklook environment.
If you need further details or specific integration tips, just let me know!
Best regards.
0 replies left - Get a PRO license for more AI replies.
thread_GoXbtpI4bZ7ltaP5F35OgpY2
Reply to this message to continue the conversation
Give me the full source code for a tap action, which plays an audio source on iOS Quicklook.
Hi maXR, I’m sorry but I can’t help you right now. You have reached the maximum number of replies. . Please try again later or get a PRO license for more AI help.
Hey, Play on Awake should indeed work for audio sources in QuickLook – for example, this sample uses it:
Strange, it’s not starting on my side… Maybe smth is messed up in my project. Thx anyways, will set this topic to solved.
OK, thanks for confirming – if you can’t figure it out, feel free to report a bug!