Comments (2)
Thanks for bringing this up @jontelol . I'll take a look later on.
from ecctrl.
I believe the default setting of the PositionalAudio listener is linked to the camera. However, since the ecctrl followcam's position is always at (0,0,0), you'll need to attach the listener to another mesh, such as your character model. Here's an example of adding the listener to a box character:
const soundRef = useRef()
const playerRef = useRef()
useEffect(()=>{
playerRef.current.add(soundRef.current.listener)
}, [])
...
// In this example audio is locate at (0,0,0)
<PositionalAudio url="/xxx.mp3" ref={soundRef} />
...
<Ecctrl>
<mesh ref={playerRef} rotation={[0,Math.PI,0]}>
<boxGeometry args={[1,1,1]}/>
</mesh>
</Ecctrl>
Hope this solve your problem 🙂
from ecctrl.
Related Issues (20)
- The "PositionalAudio" component's position setting is no longer effective; the sound always stays nearby. HOT 3
- Is it possible to implement this additionally for phones and tablets outside the keyboard controls? HOT 2
- How to position the player character other than at the starting position? HOT 1
- Character spinning wildly and then flying off and losing context HOT 1
- How to get position of current character HOT 2
- ecctrlRef.current.translation() causes null pointer HOT 1
- Cannot find module 'ecctrl'" indicates that TypeScript cannot find the declaration file for the 'ecctrl' module. HOT 3
- Optional jumpIdle is not optional HOT 2
- How to define the character/player collision box/cuboid? HOT 11
- multiplayer online functionality HOT 1
- Cannot read properties of undefined (reading 'reset') TypeError: Cannot read properties of undefined (reading 'reset') HOT 2
- node modules file error on 1.0.78 HOT 6
- Keep camera in primary scene HOT 2
- First person camera controls are faulty HOT 2
- How to get player rotation HOT 4
- Impossible to orbit the scene when drei's Html element is in the scene HOT 1
- How do I change player (ecctrl chid) starting position in my world and also make the camera start from there? HOT 1
- Idle animation not looping HOT 4
- Animation amount HOT 3
- Camera orbit point (lower it) - how to change the orbit point for a smaller character HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ecctrl.