Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Feature requests and bug reports
a tweaked move object to 3d position click behavior?

monoray
Registered User
Quote
2017-03-25 18:19:11

Ok so I have an idea, could anyone make a few tweaks to the move object to 3d position click behavior where instead of going to the clicked location, it constantly goes towards a scene node?

I'm not sure, but I feel like this would be an easy way to be able to have scene nodes follow each other. This would greatly help me (and a lot of other people too I bet). Say, in your game, you have a pet or a friend that follows you, this could be done doing this. Or you have an enemy that, when gets close enough to you, will run at you at a constant speed and execute an attack when super close to you.

I really need this for my projects and I can't really find any other way to do this, since the "set position to scene node" script is time based and ignores terrain and 3d objects.

Thanks in advance!


just_in_case
Moderator
Quote
2017-03-25 19:32:16

You can script it...yourself...

Var s = Ccbgetscenenode from name (currentnode)
Var posplayer = ccbgetscenenode property (position)

Ccbgetscenenode from name ('pet' or enemy)
Ccbsetscenenode property (position, 'posplayer')

You have to do this every seconds ....

This kind of script can help you to make any object follow another object continuously...


monoray
Registered User
Quote
2017-03-25 20:28:03

Thanks! I'm kind of a stranger to scripting myself, but I'll give it a shot! I kind of wish it could be a behavior to make things easier though.


blackwater
Registered User
Quote
2017-03-25 23:06:30

The solution by just_in_case works to some extent (and this can be done without scripting and also placing the follower slightly beside the player by changing the position, so that they are not standing on/in each other).

If the "follower" is a static object (like a flying saucer), it works (cause a saucer have perhaps not a specific "face", so any angle of it is correct).
But any object that have to face the right direction - for example living
beings with legs and/or walking animation - those do not follow well, they follow sideways/backwards etc, not facing the correct direction.

So, any suggestion in how to make this follower follow in the correct direction is very much welcome, with or without scripting :-)

Same goes with any suggestion than makes a second camera follow the player from a different angle AND face the correct direction. (the direction the first camera view had in relation to the player).
I've tested it quite a lot: Even though we have the option to follow a target with cameras (which all other objects can't), it still does not work when there is a second camera involved. (bug?)
(The result: when switching between two following cameras, the target view is somewhere else, even though it is focused on the player.)


just_in_case
Moderator
Quote
2017-03-26 03:45:25

You can also change the rotation of the object so that it will face the same rotation into the same direction.....

To do so again the above steps can be performed...
Now instead of changing position all you have to do is to change rotation....

Maybe that can work for you...


blackwater
Registered User
Quote
2017-03-26 15:17:57

Hey, j_i_c.
Initial rotation works, yes. But the follower will not rotate when the player/camera rotates. It's still in the initial direction.


just_in_case
Moderator
Quote
2017-03-26 16:08:06

Use every few seconds do something behaviour to rotate the enemy or pet's rotation with respect to the player rotation...

This will change the rotation accordingly every time the player rotation changes...

If you know scripting then there are more methods to do this...
Maybe tomarrow i will make a behavior for this....
After that all you have to do is to select the player and enemy scenenode and the enemey will start following the player..


monoray
Registered User
Quote
2017-03-26 18:05:21

A behavior for this would be amazing! I really hope you can get around to it.


just_in_case
Moderator
Quote
2017-03-27 10:48:27

Tried converting this into a behaviour but @blackwater is right.... Even after rotating it accordingly with player... It rotates sucessfully but walks in sideways..... So it is of no use .... Sorry... Didn't find any solution to that...


blackwater
Registered User
Quote
2017-03-27 12:57:28

And this does not work either i guess?
http://www.ambiera.com/forum.php?t=5093

Anyways, it works if you make a platform type of game for 2D. Or if it is a flying saucer, a rock, a specific robot which perhaps is a ball when moving, etc.

Anyways, would be glad if somebody could look into this a little deeper - should be possible to make in a 3D space.
Those interested could crowdsource funding for somebody to develop a solution.

:-)


monoray
Registered User
Quote
2017-03-27 23:49:52

I would totally be in on helping fund this behavior


Create reply:


Posted by: (you are not logged in)


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