Jump to content

Unity coin sound help

Agena_

im following this tutorial, here is my error.  

on the inspector it doesnt have the options for sound like the tutorial does. how can i fix the error?

 

Thanks

hlp.png.4eae3cfd0e455e51554d81820d411a0d.pnghel.png.b0faf8481b547042c9df05e31b5d425c.pnghelpl.png.ddb9ee12227959eece2093b6d4fc538d.png

Link to comment
Share on other sites

Link to post
Share on other sites

You have 'collectSound.play();", but the correct line is "collectSound.Play();"

Notice the capital P in "Play" in the correct line.

 

These are super small errors and anyone doing any sort of coding is bound to make them, so can't blame you 😄

So always be sure to double-check with these sorts of functions to see if they should be a capital letter or not.

"We're all in this together, might as well be friends" Tom, Toonami.

 

mini eLiXiVy: my open source 65% mechanical PCB, a build log, PCB anatomy and discussing open source licenses: https://linustechtips.com/topic/1366493-elixivy-a-65-mechanical-keyboard-build-log-pcb-anatomy-and-how-i-open-sourced-this-project/

 

mini_cardboard: a 4% keyboard build log and how keyboards workhttps://linustechtips.com/topic/1328547-mini_cardboard-a-4-keyboard-build-log-and-how-keyboards-work/

Link to comment
Share on other sites

Link to post
Share on other sites

4 hours ago, minibois said:

You have 'collectSound.play();", but the correct line is "collectSound.Play();"

Notice the capital P in "Play" in the correct line.

 

These are super small errors and anyone doing any sort of coding is bound to make them, so can't blame you 😄

So always be sure to double-check with these sorts of functions to see if they should be a capital letter or not.

haha, thanks i appreciate it. i am pretty new and realised capital letters are a problem 😄

 

one thing please, lets say i have no script or anything. 

lets say i have a car, and when it passes a point it makes a sound. how can i do that?

i attached a image, i made a object - attatched audio - and box collider set to trigger. my car just passes through it

 

helpp.png.57392431459601fd64ce6143f3fa0c4d.png

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, Agena_ said:

one thing please, lets say i have no script or anything. 

lets say i have a car, and when it passes a point it makes a sound. how can i do that?

i attached a image, i made a object - attatched audio - and box collider set to trigger. my car just passes through it

As far as I know, you can only do something with a collider in a script, to within the OnTrigger function.

You would need to make sure it only once makes a sound for colliding through that, because otherwise you could just stand still within that collider and it would go make that sound over and over.

"We're all in this together, might as well be friends" Tom, Toonami.

 

mini eLiXiVy: my open source 65% mechanical PCB, a build log, PCB anatomy and discussing open source licenses: https://linustechtips.com/topic/1366493-elixivy-a-65-mechanical-keyboard-build-log-pcb-anatomy-and-how-i-open-sourced-this-project/

 

mini_cardboard: a 4% keyboard build log and how keyboards workhttps://linustechtips.com/topic/1328547-mini_cardboard-a-4-keyboard-build-log-and-how-keyboards-work/

Link to comment
Share on other sites

Link to post
Share on other sites

23 hours ago, minibois said:

As far as I know, you can only do something with a collider in a script, to within the OnTrigger function.

You would need to make sure it only once makes a sound for colliding through that, because otherwise you could just stand still within that collider and it would go make that sound over and over.

this is another topic. 

 

my car drives perfectly, but the issue is it doenst drive in a straight line. if i just accelerate, it sloowly turns right over a medium distance.  how can i stop this

Link to comment
Share on other sites

Link to post
Share on other sites

3 hours ago, Agena_ said:

this is another topic. 

my car drives perfectly, but the issue is it doenst drive in a straight line. if i just accelerate, it sloowly turns right over a medium distance.  how can i stop this

Without any additional info on what your project is all about, this is not possible to answer.

I can point you to what you should take a look at:

1. The origin of the car. Check this picture out:

image.png.f3f3366bf6820178e1ab5de92405b10a.png

The cube is set at an angle, compared to the empty gameobject it is in. If I say to the gameobject "go forward", that is not one of the faces of the cube, but rather one of the diagonals, because it's are rotated.

Of course this is a simple example, with a larger model the issue can be exaggeration. Check if everything in the object sees 'forward' as the same time.

 

2. Your code may apply some forward and also sideways movement. That depends on the script you use.

3. Your car may just not have total grip on the road, go in the air and pick up some sideway momentum.

 

What exactly is the issue is difficult to say, but these are some pointers on what to look out for.

"We're all in this together, might as well be friends" Tom, Toonami.

 

mini eLiXiVy: my open source 65% mechanical PCB, a build log, PCB anatomy and discussing open source licenses: https://linustechtips.com/topic/1366493-elixivy-a-65-mechanical-keyboard-build-log-pcb-anatomy-and-how-i-open-sourced-this-project/

 

mini_cardboard: a 4% keyboard build log and how keyboards workhttps://linustechtips.com/topic/1328547-mini_cardboard-a-4-keyboard-build-log-and-how-keyboards-work/

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×