ambiera logo

Ambiera Forum

Discussions, Help and Support.

folder icon Ambiera Forum > CopperCube > Help with CopperCube
forum topic indicator How could I get something like this script to work?
person icon
spicymilk
Registered User
Quote
2024-01-03 00:33:28

var force = ccbGetCopperCubeVariable(strength)
var cube = ccbGetSceneNodeFromName("cubeMesh1");
ccbSetPhysicsVelocity(cube, 0, 0, force);
\

I know it's not correct and I don't know how to code so I don't know what's wrong.

If I wanted to get the variable that is set in the game, and make it so that the force applied to a object on an event how would I do that?

I'd appreciate any help, thanks

person icon
just_in_case
Moderator
Quote
2024-01-04 06:42:34

Hey, there the script is almost correct all you need to make sure that the CopperCubve variable is inside quotes. like this "strength"

var force = ccbGetCopperCubeVariable("strength");
var cube = ccbGetSceneNodeFromName("cubeMesh1");
ccbSetPhysicsVelocity(cube, 0, 0, force);


now in your coppercube editor add a behavior, before first drawing and attach action set or change variable in variable name enter strength in value enter 0.

And now whenever you want the cube to have been affected by force for example, when a key is pressed or on proximity, add the related behavior and inside that behavior you can first add the action to set the variable , and then use the strength as variable name, and put a value for it like 10.

make sure you are running the above javascript action inside an on frame even or every few seconds, otherwise you have to execute the code again and again whenever you update your force.

person icon
spicymilk
Registered User
Quote
2024-01-05 01:23:09

Thanks man I really needed it

person icon
spicymilk
Registered User
Quote
2024-01-05 01:44:42

I don't know why but I can't get it to work either

person icon
Guest
Guest
Quote
2024-01-05 04:12:08

Make a small example project with your issue so we can see how you are setting things up. Guessing is a waste of people's time.

person icon
just_in_case
Moderator
Quote
2024-01-05 05:40:30

yeah, a sample ccb would be much better to help you out. It is supposed to work make sure that you have physics simulation turned on for your project.

person icon
spicymilk
Registered User
Quote
2024-01-07 01:47:19

Yeah I can send the file over when I get to my computer and thanks just_in_case.

Guest, you got to chill out bro and your grammars terrible I'm not trying to waste anybody's time. I couldn't get it to work,
If your gonna hate use an actual account little bro.

person icon
Guest
Guest
Quote
2024-01-07 08:20:08

The first message "Make a small example project with your issue so we can see how you are setting things up. Guessing is a waste of people's time." appears to be grammatically correct, as no apparent errors are evident in the text.

The second message "Guest, you got to chill out bro and your grammars terrible I'm not trying to waste anybody's time. I couldn't get it to work, If your gonna hate use an actual account little bro." contains several errors:

1. "grammars" should be "grammar's" to indicate possession.
2. "If your gonna hate" should be "If you're going to hate."
3. The message lacks proper punctuation and capitalization.

Therefore, the second message is less grammatically correct. The first message is the most grammatically correct.

person icon
spicymilk
Registered User
Quote
2024-01-07 18:06:46

"guessing is a waste of peoples time" is broken English

I don't care about punctuation as long as the text is readable and makes sense

person icon
Guest
Guest
Quote
2024-01-07 21:39:50

The statement "guessing is a waste of peoples time" is not broken English. It is a valid expression in English, meaning that making guesses is a futile or unproductive use of time. The phrase "waste of time" is a well-established English idiom, commonly used to refer to a bad use of time. Therefore, the original statement is grammatically correct and conveys a commonly understood meaning in English.

person icon
spicymilk
Registered User
Quote
2024-01-07 21:45:51

your right my bad I thought you meant it in another way

person icon
spicymilk
Registered User
Quote
2024-01-08 05:52:40

turns out I didn't save the file correctly, I can cash app anybody who could set it up for me basically what I need it to do is the longer the key is pressed down the greater the force the ball is thrown with

I'd appreciate it you could send me a video of it working and then ill pay you then you send me the file

hope someone can help thanks

person icon
Guest
Guest
Quote
2024-01-08 06:11:02

How much you are willing to pay?

person icon
spicymilk
Registered User
Quote
2024-01-08 06:27:07

10 bucks

person icon
spicymilk
Registered User
Quote
2024-01-08 06:29:32

and i'd like it to where the up and down rotation doesn't affect the trajectory if that's 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 |