🐉
Portfolio
  • Portfolio Jay Fairouz
  • Introduction Week
  • XR Concepting and Design
    • Concepting and Design Summary
    • XR Concept and iteration
    • Brown boxing
    • White boxing
    • Inspark
    • Shoeby
    • Specialisten Net
    • Walking Design
    • Multiple people in one body room
    • Environment
    • Echolocation Room
    • Portals
  • XR Assets
    • XR Assets
    • Temple Owl Logo
    • Platforms
    • Animating a moth
    • Color palette Echocave
  • XR Development
    • Development Summary
    • Dragon Race VR Development
    • Audio Visualizing
    • Walking Development
    • Glass Beads
    • Inhabit mechanic
    • Waterfall
    • Path creation
    • Learn someone how to program
    • Voice input mechanics
    • Paint
    • Portals
  • XR Testing
    • Dragon Race VR Testing
    • XR Testing
  • Group Process
    • Company Pitches
    • Sprint 1
    • Sprint 2
    • Sprint 3
    • Sprint 4
    • Sprint 5 and project conclussion
    • Project Goal
Powered by GitBook
On this page

Was this helpful?

  1. XR Development

Glass Beads

PreviousWalking DevelopmentNextInhabit mechanic

Last updated 3 years ago

Was this helpful?

I was tasked with making a chain out of musical beads. I wanted users to be able to engage with this in a playful manner. I found it important for users to instantly be interested in the beads and to engage with them. Furthermore I wanted the interaction with them to feel natural. Here's a video that demonstrates it (turn on your sound):

I made the bead chains by using the Unity hinge joint component and adding the previous bead as the linked object. The first bead is has a kinematic rigidbody without gravity so the chain will stay in place.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[RequireComponent(typeof(AudioSource))]

public class GlassCollision : MonoBehaviour
{
    [SerializeField]
    private AudioClip[] audioClips;
    AudioSource audioData;
    private float minPitch = .75f;
    private float maxPitch = 1.5f;

    void Start()
    {
        audioData = GetComponent<AudioSource>();
    }

    private void OnCollisionEnter(Collision collision)
    {
        int randomClipIndex = (int)Random.Range(0, audioClips.Length - 1);
        float randomPitch = Random.Range(minPitch, maxPitch);

        audioData.pitch = randomPitch;

        audioData.clip = audioClips[randomClipIndex];
        audioData.Play(0);
    }
}
16MB
FTRProject - Waterfall - PC, Mac & Linux Standalone - Unity 2020.3.18f1 Personal _DX11_ 2021-11-18 14-45-13.mp4