ambiera logo

Ambiera Forum

Discussions, Help and Support.

folder icon Ambiera Forum > CopperCube > Help with CopperCube
forum topic indicator Variables and Values Problem
person icon
guest_Des
Guest
Quote
2025-08-10 12:42:18

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

person icon
guest_guest
Guest
Quote
2025-08-10 17:18:32

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.

person icon
sven
Registered User
Quote
2025-08-10 17:38:12

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.

person icon
guest_Des
Guest
Quote
2025-08-10 17:57:46

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


Create reply:










 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


icon_holyicon_cryicon_devilicon_lookicon_grinicon_kissicon_monkeyicon_hmpf
icon_sadicon_happyicon_smileicon_uhicon_blink   






Copyright© Ambiera e.U. all rights reserved.
Contact | Imprint | Products | Privacy Policy | Terms and Conditions |