Getting actor to "wiggle"

jakemiller13jakemiller13 Member, BASIC Posts: 2

Hi all,

Pulling my hair out here as I've been trying to get this to work for days. How can I get an actor to wiggle back and forth?

What I'm trying to have happen is a fish move across the screen in a wave pattern. My thought was to give it forward motion as one behavior, and then have conditionals that trigger it to Rotate to Angles back and forth when it reaches certain extremes (+/- 45 degrees). No matter what conditionals I give it, I can't get it to rotate back and forth. I've tried many combinations of Rotate to Angle, Rotate, Loop (not supposed to work with Rotate anyways).

Any ideas? Thank you!

Comments

  • SocksSocks London, UK.Member Posts: 12,822
    edited March 2018

    "What I'm trying to have happen is a fish move across the screen in a wave pattern"

    Constrain X position to A*sin(game.time*B )+C

    C is the centre point of the movement, A is the extent of the movement in pixels, B is a multiplier to speed up or slow down the movement.

    You can also use a sine wave to rotate an actor.

    Constrain Rotation to A*sin(game.time*B )

    A is the extent of the rotation in degrees from 0°, B is a multiplier to speed up or slow down the rotation.

  • jakemiller13jakemiller13 Member, BASIC Posts: 2

    Oh my god, of course! I didn't think about using an actual sine function. Thank you!

  • Twayne2Twayne2 Member Posts: 458
    edited June 2018

    God is capitalized. Also please don't use His name in vain. Thanks. :)

  • RowdyPantsRowdyPants Member Posts: 465

  • SocksSocks London, UK.Member Posts: 12,822
    edited June 2018

    ..

  • AlchimiaStudiosAlchimiaStudios Member Posts: 1,069

    Hmmm... B)

    Follow us: Twitter - Website

  • RowdyPantsRowdyPants Member Posts: 465

    @AllMyGSHomies I didn't mean to offend anybody. Just trying to lighten the mood.

    I used to take hard life stuff (like religion) very seriously. I've learned there's value in being able to poke fun at myself and just relax a bit.

  • rainwaterstudiosrainwaterstudios Member Posts: 198

    @Twayne2 said:
    God is capitalized. Also please don't use His name in vain. Thanks. :)

    Lol, sorry chump but I will use "his" name in any manner I choose to. You're welcome :)

  • Twayne2Twayne2 Member Posts: 458

    Sorry, it was not my place to bring it up. Please forgive me. I wish you luck and hope you turn to the Lord. Please close this thread.

  • rainwaterstudiosrainwaterstudios Member Posts: 198

    @Twayne2 said:
    Sorry, it was not my place to bring it up. Please forgive me. I wish you luck and hope you turn to the Lord. Please close this thread.

    You're right, it wasn't your place at all. Your comment was unwarranted, off-topic, and served no positive purpose.
    I'll consider granting you my forgiveness, only AFTER you stop 'hoping' that I 'turn to' your deity.
    Frankly, you owe an apology to @jakemiller13 for hijacking his post, and you have no right to ask for this thread to be closed.

  • PhilipCCPhilipCC Encounter Bay, South AustraliaMember Posts: 1,390

    @jakemiller13 You've just learnt how easy it is to get in trouble around here... and having fun is not permitted, but we do it anyway. >:)

Sign In or Register to comment.