Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
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! |
||||
|
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... |
||||
|
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. |
||||
|
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.) |
||||
|
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... |
||||
|
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. |
||||
|
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.. |
||||
|
A behavior for this would be amazing! I really hope you can get around to it. |
||||
|
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... |
||||
|
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. :-) |
||||
|
I would totally be in on helping fund this behavior |
|