Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
I was wondering if somebody could help me with a script where whatever the variable value is the force is applied to an object on a key released thanks |
||||
|
well, it depends on how you are creating your game. if you are using physics simulation then you can do .
this will apply a force of 10 on the Z axis of the cube mesh, you can change the value of force. If you want to apply force on a different side, then just replace the 0 with force variable name, and then that force will be applied on that axies too. If you are not using the physics simulation, then you have to use the timing controls as welll, or incremention values to move the scenenode continuously untill you get to the desired value or result. you can use the ccbSetSceneNodeProperty() command and use the "Position" or "PositionAbs" attribute to change the position of the scenenode, you can also use a lerp function to make the movement smooth so that it will look much better. |
||||
|
thanks I'll try this |
||||
|
if you were in game how would you change how much force is applied? |
||||
|
WHAT IS THE POWER BROTHER, THIS APPLY TO THE PHYSICAL SIMULATION AND WEIGHT OF THE OBJECT? |
||||
|
@writer No offense man, but your content is hard to read and is often seen as silly shouting on forums when you constantly write in all caps. I would imagine no one would want to help with your query with that style of question. |
||||
|
I get what he was saying though my bad, in the script it changes the variable so every time it's run that's how much power the cube is moved with. I'm using the physical simulation and each time I run that code, with the first line of code removed from the script it doesn't work and I can't get the variable to be changed in game and affect how far the cube is shot out. also English isn't my first language so if any of that didn't make sense I could try to put it in a different way |
||||
|
|