playMaker

Author Topic: Position ++1  (Read 173 times)

qaaz345

  • Playmaker Newbie
  • *
  • Posts: 34
    • View Profile
Position ++1
« on: December 31, 2018, 10:31:58 AM »
Do this to increase the distance of the X-axis at a certain time interval.

Get position
x = n

add float
n = (n + 1)

Set position
x = n

Isn't there an easier way?

Thore

  • Full Member
  • ***
  • Posts: 153
    • View Profile
Re: Position ++1
« Reply #1 on: December 31, 2018, 10:36:33 AM »
If nothing else is affecting x, you don’t need n. Just x + 1, and set position.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 3812
    • View Profile
    • jinxtergames
Re: Position ++1
« Reply #2 on: January 02, 2019, 04:06:34 AM »
Hi.
With 'Translate' you can add per second also with 'float add'

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 13857
  • Official Playmaker Support
    • View Profile
Re: Position ++1
« Reply #3 on: February 06, 2019, 11:38:13 PM »
Hi,

 It's difficult to make this easier than as you describe it, it's totally fine. It's tricky sometimes to assess if a pattern can be optimized or not, and at some point the work has to be done somehow, so getting the position, modify it and setting it back is as close as you can get to a minimal pattern.

then, as other replies suggested, you can use translate for a constant movement, it depends on your time interval and how you want the movement of the object to be.

Bye,

 Jean