Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Help with CopperCube
bird flying

shihan44
Registered User
Quote
2022-01-01 11:23:48

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...


just_in_case
Moderator
Quote
2022-01-01 17:34:01

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...


shihan44
Registered User
Quote
2022-01-01 21:44:45

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 :)


just_in_case
Moderator
Quote
2022-01-02 05:47:09

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:)


serguell
Registered User
Quote
2022-01-04 03:44:51

I would like to see the finish work of your bird project. If you can show a video demonstrate your work.


shihan44
Registered User
Quote
2022-01-06 03:59:12

sure i will share it with you once there is something worth showing :)
still struggling with it.
cheers


sven
Registered User
Quote
2022-01-08 09:26:56

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=...


shihan44
Registered User
Quote
2022-01-10 02:22:52

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 ...


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