ORBZORBZ Member Posts: 1,303
edited November -1 in Introductions
Random x movement without complicated rules, etc.

This little guy is moving without any user input.

Enjoy :)



  • beefy_clyrobeefy_clyro Member Posts: 5,390
    I look forward to getting on my mac so i can take a look at this, i have a game im starting to work on where i'll make good use of this. Thanks
  • beefy_clyrobeefy_clyro Member Posts: 5,390
    Just wondering, could some Y movement be added into this as well?
  • ORBZORBZ Member Posts: 1,303
    Yes, very ez. One line. I kept Y axis out to simplify the demo.
  • jstrahanjstrahan Member Posts: 498
    Love it got ideas already coming
  • beefy_clyrobeefy_clyro Member Posts: 5,390
    Sweet. I would want the Y random moving like the X, i take that it would be the same but replacing the X's with Y's?
  • ORBZORBZ Member Posts: 1,303
  • FanStudioUKFanStudioUK Member Posts: 459
    this is a great example!

    I'm trying to use it in my game, every 3 seconds to spawn an actor at self.position.x and self.position.y but it's not working....

    it's not spawning anything.

    any idea why ?

    thank you
  • FanStudioUKFanStudioUK Member Posts: 459
    I did manage to make it spawn actors but it doesn't read the random position.x of the cube's movement.... this is strange!
  • ChaserChaser Member Posts: 1,453
    Im not at computer to see file but I did the same thing with 1 actor and 2 timers
    1 says every 3 seconds change velocity speed 60 to 0 degrees and the other timer every 4 seconds do the same thing at 180 degrees. Looks random and sometimes goes more left and others goes more right
  • FanStudioUKFanStudioUK Member Posts: 459
    why it doesn't constrain the position.x to the movement?
  • FanStudioUKFanStudioUK Member Posts: 459
    did anyone tried this?
  • ORBZORBZ Member Posts: 1,303

    Make a sample project illustrating your problem so I can see what you're talking about. I don't understand the problem you are having.
  • FanStudioUKFanStudioUK Member Posts: 459
    I opened your template and inside the Spaz I put the follwing action:

    Timer: every 2.5 seconds to spawn a parachute (having the Spaz's self.position.x) that is moving down slowly...

    The Spaz is spawning the parachutes but only in the middle of the screen and I don't understand why is not spawning them at the random position.x of the Spaz.

    Any idea why ?
  • FanStudioUKFanStudioUK Member Posts: 459
    Ohh, I got it! FINALY!

    In the parachute actor I was using Interpolate with self.position.x also that was why it was spawning it from the same spot :D

    Sorry for the trouble Orbz, your templates are so inspiring!!!
  • ORBZORBZ Member Posts: 1,303
    I think i understand what you are doing.

    Try this:

    In your parachute actor, remove all behaviors and rules. Then just set the motion.linearVelocity.y = -30

    The in the spaz actor just spawn the parachute at location 0,0 relative to actor.

    That should do what you want without needing to interpolate the parachute down the screen.
  • FanStudioUKFanStudioUK Member Posts: 459
    The problem was that the parachute has a pendulum movement

    Constrain: Self.Position.X to 20*cos( self.Time *100%360)+240

    That's why it's not working as I want...
  • ORBZORBZ Member Posts: 1,303
    Ahh, gotchya. Well in that case keep the constraint on the x movement but also set the motion.linearvelocity.y to -30. That way you don't have to interpolate y.

    Of course, if you WANT to interpolate y, you can. It doesn't hurt.
  • FanStudioUKFanStudioUK Member Posts: 459
    I don't think I get it...but I can only spawn the parachutes at the Spaz random position only if I remove the pendulum movement...
  • FanStudioUKFanStudioUK Member Posts: 459
    I forgot to mention, for the Spaz I'm only using the motion.linearVelocity.X - I'm interested only in the X random position
  • ORBZORBZ Member Posts: 1,303
    If you want you can send me your project and I'll take a look at it.

    s o u l a t o r b z d o t c o m
Sign In or Register to comment.