Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Help with CopperCube
How to move cube with physics

c123
Registered User
Quote
2023-06-26 14:18:43

I'm making a physics-based game in which you control a cube.
I've given the cube affected by physics engine and a player controller but since that doesn't work I tried to use the ccsetveloctiy command but I can't seem to figure out how to use it. I need help in making the cube move in forward, backwards, left and right and also jump. Having the cube rotate it the direction it moves will also be very nice. Could someone help me?
Link to file: https://backlash-game-studios.itch.io/cube-project


Guest
Guest
Quote
2023-06-27 00:38:01

Make sure you go to Tools > Publish settings > Physics Engine and change it to Physics simulation.

Change your code to this:
var main = ccbGetSceneNodeFromName("main");
ccbSetPhysicsVelocity(main, 0,30,0);

Cube should jump now.

Recommend you read the documentation if you have not:
https://www.ambiera.com/coppercu...


c123
Registered User
Quote
2023-06-27 12:35:31

It works now, thank you very much.


zeedom
Guest
Quote
2024-04-01 07:19:03

where i can edit physics engine script


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Internation?l" (you are not logged in)


Text:

 

  

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


   






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