Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
Hi guys, I've encountered a little problem So in a game project I'm making, I want the player to collect 3 papers and after collecting those papers, a sound plays But when I use variables and values for this, and I use every few seconds if a variable=3 play sound, the sound plays continuously because it actually plays every few seconds, how do I make it play once? Please help |
||||
|
You can do it like this, when collected a paper you add a if statement to it that asks if the value of the collected papers is 3, if yes then play the sound. |
||||
|
it keeps playing because value is 3.. while its 3 it keeps doing it. there is many ways how to prevent this.. depends do you need that value in game later again :: you can just set this value to 0 after play sound. also instead of checking that value on every frame you can check it on every pickup.. If picked up then check is it 3 ..if 3 play sound.. pickup done. you can use another value that states is mission collect 3 papers completed or not.. if papers not 3 then mission not completed if papers 3 then set completed 1 if compleded 0 and papers 3 PlaySound set completed 1. huge amount of possibilities to prevent this.. hope it gives some ideas. |
||||
|
Thank you sven and guest.it works I have some few additional requests too, I would be glad if you could help me out,please help me out 1. A way to scale a node from one node(player camera) to a different node, I want to do this for a grapple hook so that when I shoot a wall I change position of a 3d node relative to last bullet impact, so that the cable scales from the player camera or node attached to player camera to the the node that changed position relative to last bullet impact. 2.I want to use ccbAICommand Javascript function to move a node relative to a different node, I want the short script that I have to execute as Javascript to make that possible |
||||
|
|