GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Getting actor to "wiggle"

jakemiller13jakemiller13 Posts: 2Member, BASIC

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.Posts: 12,821Member
    edited March 22

    "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 Posts: 2Member, BASIC

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

  • Twayne2Twayne2 Posts: 302Member, PRO
    edited June 17

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

  • RowdyPantsRowdyPants Posts: 408Member, PRO

  • SocksSocks London, UK.Posts: 12,821Member
    edited June 20

    ..

  • AlchimiaStudiosAlchimiaStudios Posts: 966Member, PRO

    Hmmm... B)

    Follow us: Twitter - Website

  • RowdyPantsRowdyPants Posts: 408Member, PRO

    @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 Posts: 152Member, PRO

    @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 Posts: 302Member, PRO

    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 Posts: 152Member, PRO

    @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 AustraliaPosts: 1,370Member, BASIC

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