From the course: AR Development Techniques 02: Lighting and Physics

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

AR bowling: Part 2

AR bowling: Part 2

From the course: AR Development Techniques 02: Lighting and Physics

Start my 1-month free trial

AR bowling: Part 2

- Right now we are applying a force of hundred on the ball object. What if we want to have some more control over this value? So that we can change the amount of force that is applied. To do that, let's add a slider so that we can change the value of the force from our UI, go to canvas, right-click, UI and create a slider. And let's position this at minus 250 in the x-axis and minus 150 in the y-axis and let's anchor these two. So this slider is at bottom left corner and the launch ball button is at bottom right corner. The value of this slider ranges from zero to one. So let's get the reference of this slider inside our code. Create a new variable, public. This will be a slider variable. To access the slider, We have to import the UI package using unity engine dot UI. We named this variable slider, save the script, go to unity, click on the bowling pins object and let's drag the slider right here. Now we…

Contents