lukezero's Forum Posts

  • You do not have permission to view this post

  • It’s probably not random.

    You sound like you have a specific behavior you’re after that you have footage of or have seen. You could start by examining the motion of one leaf and trying to break it down into a path that you could replicate somehow. Worst case you could maybe use a timeline to manually plot a path. With two or three varieties you may get enough variation.

    At the other end of complexity you could try some grid based fluid dynamics to model airflows. Then the leaves would move based on where they were within it since you would have velocity at any point. Then you could model the leaves as slightly curved apply the wind to them based on the angle the wind hits them.

    There are probably many options in between. I don’t have any specific examples in mind though.

    Ok, dude. I'm doing some tests here. Thanks one more time for you help. :)

  • R0J0houndSorry to bother you again, but what do you suggest I do to create a random behavior of leaves being blown away by the wind?

    I tried here using Sine and Rotate, but I still didn't get the randomness we see in nature. :(

    PS.: I tried with Particles, and it didn't worked well too.

  • You don’t want to use Sprite.width since it’s changing. Worst case just use a fixed number such as 64 or whatever width you want it to start at when not rotated.

    I guess it’s sprite.ImageWidth not originalWidth.

    It worked! :D

    Thank u one more time!

    You're awesome!

  • What I'm trying to implement here is an effect of leaves falling randomly from the top of the screen (tree canopy). The rotation around the Y axis itself is to simulate three-dimensionality in a 2D game.

  • Probably just:

    Var rotY=0
    
    Every tick
    — add 50*dt to rotY
    — sprite: set width to self.originalWidth*cos(rotY)

    Also it’s probably not necessary to post the question twice in both the c2 and c3 sections. The forum is already slow and most just look at new posts so they’ll see the question no matter where you post it.

    Since i'm using C2, I try to use just your code (disabling everything else shown in the attached image above), but the leaves disappear as soon as they turn 180 degrees. :(

    C2 doesn't have the "originalWidth" function, so I replaced it with self.Width.

    PS.: Sorry for the duplicate post. ^^

  • Hello friend, do you have a animation of what you are trying to achieve?

    im confused by trying to understand what you mean by rotate around its own Y axis?

    is it a 3d game ? or effect?

    top down view?

    usually X axis left right Y axis forward backward Z top down.

    so u see why my confusion ...

    in C3 default camera is top down, or sideview... depends who u ask...

    so rotate works as intended rotates from origin or "center" point of sprite clockwise or counterclocwise as u experienced, what you want i think considering is a "leaf" animation correct me if im wrong>>>

    you want the leaf to fly straight then make a round trip then continue its journey? like a gust of wind? or what is the final achievement?

    I'm using C2 and it's a 2D platform game. :)

    I'm trying to implement a falling leaf effect.

  • Hi guys!

    I tried so many times here, but I didn't (image below). :(

    These tests above even work, but the object simply disappears when it rotates 180 degrees!

    How do I rotate an object in C2 along its own Y axis (without having to resort to animation)?

    Thanks in advance! :)

  • You do not have permission to view this post

  • You do not have permission to view this post

  • It's working!

    I had forgotten to declare one condition and that was the whole cause of the problem! Sorry for the inconvenience!

    It workd with the "In between values" expression! :D

  • you can also do this in one expression (system evaluate), i.e.: (value >= 5 & value <= 10) | (value >= 15 & value <= 20) | (value >= 25 & value <= 30)

    Thanks, dude, but the C2 doesn't have this expression. :(

  • Maybe I understand this wrong, but do you want a three 'between values' condition as an or-block?

    Each condition (value range) of the same variable will get his own result.

    For example:

    If the COUNT variable is between 0 and 5, the HUD expresses X.

    If the COUNT variable is between 6 and 15, the HUD expresses Y.

    And so on.

  • I thought it was, sorry about that. Then you should use the Is Between Values condition, which will do what you are describing. You just need to provide the value you are testing and the lower and upper bounds of the check.

    Add conditions for each range you want to check and you should be good.

    I already tried it. :(

    I really need a project example or something like that to understand how this works.

  • It should be part of the System.

    Unfortunately, he doesn't appear in C2. :(

    Do you have an alternative?

    (I swear I tried solutions with IA, but it only returned errors this time)