Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Help with CopperCube
changing the position of a scene node by click

guest99
Guest
Quote
2023-07-27 18:28:48

So I've searched it on the forums but can't find anything to help with my issue

so Say it was a top down football game and I wanted to throw the ball from a top down perspective by clicking on the field where I want it how would I do that?

any ideas?


hadoken
Guest
Quote
2023-07-27 19:26:56

@guest99, maybe this helps:

Move object by click into 3D world extension:

https://ambiera.com/coppercube/d...

https://neophyte.cf/ccb_behavior...


guest99
Guest
Quote
2023-07-27 22:52:29

I was trying to use that but for the game I'm trying to make I need the option to select which scene node I want to throw instead of just throw this one yk I hope that makes sense


hadoken
Guest
Quote
2023-07-28 01:16:46

@guest99,

here is an alternative quick and dirty adjusted version of the mentioned script letting you specify and change the affected scene node at runtime by assigning the corresponding scene node name to the CopperCube variable called ClickMoveObject - small demo included (must be terminated with [Alt+F4], ESC not set for closing app yet ...):

https://www.dropbox.com/scl/fi/z...


guest99
Guest
Quote
2023-07-28 02:06:05

@hadoken Thanks I really appreciate it, Thanks man


guest99
Guest
Quote
2023-07-28 02:20:35

@hadoken Sorry to bother you again but I was wondering if it was possible to say when you throw that football you can't do it again but it still gets to the location it needs to, Thanks


hadoken
Guest
Quote
2023-07-28 09:26:21

@guest99,

try this revision, first node has to finish position change before another node and another click position will be accepted for executing behavior (includes debug_info option for console messages):

https://www.dropbox.com/scl/fi/e...


guest99
Guest
Quote
2023-07-28 18:26:13

@hadoken,

I'm sorry I still don't understand how this works


hadoken
Guest
Quote
2023-07-28 19:22:35

@guest99

1.) assign the behavior behavior_MoveCCVarSpecifiedObjectByPositi.js (v2!) to any visible node

2.) use on scene root -> Before first drawing do something -> Set or Change a Variable -> name variable ClickMoveObject and set your ball scene node as value

3.) if you click on the field in-game, the ball should move to the clicked position, after that the ball would move to another clicked position

4.) to stop the ball moving to any mouse clicks set ClickMoveObject CopperCube variable to any other invisible node out of screen (that could e.g. be triggered by a key press or On proximity ... behavior ...)

5.) to reactivate ball moving set variable back to ball node

If that explanation doesn't help at all, feel free to post your scene project file for us to have a look into the issue ....




guest99
Guest
Quote
2023-07-29 01:55:06

@hadoken I really appreciate all the help, I'm more of an artist(not a good one) than anything. https://1drv.ms/u/s!AiaHd2kpdCny...

thanks,


guest99
Guest
Quote
2023-07-29 01:55:47

Oh, and sorry for putting you through this


hadoken
Guest
Quote
2023-07-29 18:01:06

Hi @guest99,

had a look into the current state of your project:

so far you have:

- a ball game field
- a player controlled by keyboard
- a visible mouse cursor ready to click and trigger things

please let me know in more detail what should now happen next, what do you exactly want to achieve? (e.g. click into the field and a ball jumps in at the clicked position or click into the field and the player moves there ...)

(besides, I'm not familiar with areal football game is played ...)




Guest99
Guest
Quote
2023-07-29 20:29:12

@ hadoken thanks for taking a look at it.

I just want to get it to where the player can throw the ball across the screen and go from there.

The throwing is the only thing stumping me right now.

Thanks,


hadoken
Guest
Quote
2023-07-30 10:27:11

Hi @Guest99,

1.
Should the player's movement be controlled via the keyboard as already set or by mouse click on the playing field?

2.
Should the player throw a ball by keystroke or by mouse click?

3.
Should the ball be thrown straight ahead from the player or from the edge of the field, must it rather fly in an arc?

4.
Should the player automatically move to where the ball lands?

5.
I assume the ball has to go into or through one of the two forked goals, right?

Cheers.


Guest99
Guest
Quote
2023-07-30 16:55:48

@hadoken

1. Keyboard

2. Mouse click

3. Straight from the players arms(it’s on a mixamo rig
If adding arc is possible it’d definitely be preferred. If it’s not possible I could have a scrip that checks where the mouse was clicked and if the ball goes into that radius it sets a value to one and if the value is 1 the players can catch.

4 what I was thinking for that is when the ball is throw the closest active camera to where it was thrown gets switched and we switch the player out for another

5. Not in the base gameplay but In American Football when you score you have the option to either kick the ball into the forked goalpost or start at the 5 and run a play ( more risky ) for 2 points instead of 1 when you kick

I really appreciate your replying

I know it’s allot

Thanks


Create reply:


Posted by: (you are not logged in)


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