Writing Expressions


#1

I want to compare X positions of two Objects like:
If
x position of Object 1 > x position of Object 2
then
set x position of object 1 = x position of object 2 and vice versa.


#2

Try this…
positions.png


#3

writing expression like object2.() gives an error. I’m new to this. Is there something wrong I might be doing?


#4

So the general format is:

  • Object name
  • Period ‘.’
  • Property name
  • Open bracket ‘(’
  • Any parameters the property requires
  • Close bracket ‘)’

In this case, your object is called ‘object2’, and the property you’re wanting to get is ‘X’ (and it doesn’t require any parameters). So what you need is: object2.X()
Hope that helps.


#5

Thank you! will try to implement.