Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sound effects: glasset knuser når noen vinner #3

Open
Buggz opened this issue May 14, 2019 · 0 comments
Open

Sound effects: glasset knuser når noen vinner #3

Buggz opened this issue May 14, 2019 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@Buggz
Copy link
Collaborator

Buggz commented May 14, 2019

Vi trenger en lydeffekt når en av spillerne kolliderer med målet og glasset knuser.

Fremgang:

  1. Gå til "Prefabs"-mappa, marker "Player" og i Inspector oppe til høyre klikker du "Open prefab"

  2. "Add Component" -> "Audio source"

  3. Lag eller finn en royalty free lydfil som du synes passer bra

  4. Lag eller finn "Sounds"-mappe

  5. Dra inn fila di her

  6. Drag&drop fila inn som "AudioClip" i Inspector->AudioSource

  7. Fjern hake ved "Play On Awake"

  8. I "PlayerCollision" må du finne "OnTriggerEnter" og bruke GetComponent<AudioSource>().play() (merk liten p i play)

  9. Go wild

OBS: Hvis det er flere AudioSources vil du måtte bruke GetComponents<AudioSource>() (med s) for å få et array og så velge riktig. De kommer i samme rekkefølge som vist i Inspector

@Buggz Buggz added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers and removed help wanted Extra attention is needed labels May 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant