Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
Hi, i am simulating a bird flying (on proximity to a decoy on ground or called by a caller) change position by -y vector to land on ground. the problem is how the bird gonna tell where is ground to stop flying and use animation for landing symmetrically and smoothly to the ground ? cheers... |
||||
|
there you go, you can use the behavior to do something when an object is on the ground. You can set a variable " bird_grounded" with the value "true' and check every few seconds if a variable has a value, variable name "bird_grounded" is equal to true then do something. Download the behavior from here:- https://neophyte.cf/ccb_behavior... |
||||
|
thx man, i did as you said, created a variable every few seconds do something 10 ms , variable name bird_grounded equal to 0. then added to the bird , do something if an object is on ground and added if variable has value, variable name, bird_grounded equal to 0, action change animation. i am getting a message floor not found. tried to add collider to bird no difference. did i do something wrong or there is something missing ? thx for help :) |
||||
|
Yes, that's how it is supposed to work, you can say if there is no ground below and the player( bird) is in the sky it will print "floor not found". but once it reaches the ground it will execute the action and will set the variable. you can ignore the debug console msg, it is there to make sure that there is ground (floor) below the object. also, make sure the ground is a static Mesh object it shouldn't be an animated object. You can try making the bird reach the ground, it doesn't matter if you have collided when moved behavior is attached to your player(bird) or not it will just work without it. But if you are using the collide when moved behavior then makes sure to adjust the "Y" axis of the collision ellipsoid for the player, I recommend you to put a very low value there to get started and then increase it accordingly until the behavior stops working so that you can get the exact maximal collision value for "Y" up to which the behavior will work. The last most important thing here is to make sure the Collision is enabled for the ground. If you are using custom 3D mesh or planes or cubes as floor make sure Collision is turned on for them. It doesn't matter if your player(bird) has collision ON or OFF but you need to check the ground collision, if it is turned off then simply turn it on. Hope that helps:) |
||||
|
I would like to see the finish work of your bird project. If you can show a video demonstrate your work. |
||||
|
sure i will share it with you once there is something worth showing :) still struggling with it. cheers |
||||
|
wrote: sure i will share it with you once there is something worth showing :) still struggling with it. cheers I have made something that may help you: https://drive.google.com/file/d/... There is two project files.. one is where bird will fly on player arm if called-and then back to where it came.(needs scripting if you want to use it) Another example is just moving by Y axis to the ground. (no scripting needed) Youtube video: https://www.youtube.com/watch?v=... |
||||
|
thx Sven, this is really helpful for me, will try to understand the coding as well :) it seems there is different ways in doing the same thing : found out this way as well while searching and trying, did it with follow path, you can shoot the bird as well with left mouse button and will change animation on hit. https://drive.google.com/file/d/1LjpjfGwYbGDmumSQxUBxUj3sRBun6E-M/view?usp=sharing but i think your way is better because i might need later on to add : if bird not hit fly away again in different directions and with follow path i think it might be a problem. cheers bro and thx again:) i am subscribed on your youtube channel from a while ago as well ... |
|