Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Help with CopperCube
Positiion On A Path with Key Press

morbott
Registered User
Quote
2018-07-11 06:33:12

Can I control an object's position along a path with a key press?
So when I press key... it moves along the path... when I release the key it stops... when I press again... it continues from where it stopped.
Thank you,
M


just_in_case
Moderator
Quote
2018-07-11 09:10:43

No, i tried doing this before, but didn't find a way to do it...

ccbaicommand "cancel" will stop the object but also crashes the game. and then using restart behaviour of a scene node ... but it will make the object appears to move from the starting point of the path node... not from where we stopped it...

everytime i use ccbaicommand "cancel" for an object moving on a path.. my app crashes..

so according to me currently it is not possible to do this without greater knowledge of scripting.


wild-master
Registered User
Quote
2018-07-11 13:25:01

everytime i use ccbaicommand "cancel" for an object moving on a path.. my app crashes.

The "ccbAICommand()" function requires the "Game Actor with Health" Behavior to be attached to the same object. It will crash CopperCube every time it's used by an object that doesn't have that Behavior attached. When you tried using "cancel", did your objects have the "Game Actor with Health" Behavior attached to them?

The "cancel" feature is designed only to stop objects that are moving with this code:
ccbAICommand(object, "moveto", newposition);
It's not a general "stop" feature that can stop ALL movement.


just_in_case
Moderator
Quote
2018-07-11 15:55:23

Well i already knew that ccbaicommand will require "game actor with health and Ai behavior" to be attached to the object..and my app was crashing even with that behavior attached...

My post was made with refrence to the version 5.4 of coppercube the time when i tried to do this...it may be possible that it is fixed now in newer versions of coppercube....

And cancel command will stop any kind of movement,rotation and all... It is not necessory if the object is being moved by the ccbaicommand moveto function....




wild-master
Registered User
Quote
2018-07-11 16:27:39

I am using CopperCube 5.7.1.

The "cancel" feature of the "ccbAICommand" function ISN'T a general "stop all movement" feature. It will stop movement ONLY if it's created by the "moveto" or "attack" features of the "ccbAICommand" function.

Try this example:
https://drive.google.com/file/d/...

1. Start that example, and you will notice that the Cube is moving.
2. Press your spacebar to send the "cancel" command to the Cube.
2. You will notice that the Cube still moves. The Cube's movement isn't created by the features of the "ccbAICommand" function, so the "cancel" command WON'T work.

You're misinterpreting your memory of the "cancel" feature. When you noticed that the objects stopped moving with version 5.4 of CopperCube, you thought the movement was stopped BECAUSE OF the "cancel" command, but that's NOT what happened. The reason why the movement stopped is that the game froze. You thought the "cancel" command stopped the movement and the game became frozen AFTER that, but the lack of movement was actually caused BY the freezing process.

You should never misinterpret your memories!


just_in_case
Moderator
Quote
2018-07-11 16:32:50

Awkey... Let me go home and try it out by myself... It may be possible that am misinterpretating from my memory...😂


just_in_case
Moderator
Quote
2018-07-11 16:53:11

Yup @WildMaster is absolutely correct... My memory cheated me...
Sorry for misinterpreting...


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "?nternational" (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