One actor moves toward another based on proximity?

Jeffm2Jeffm2 Member, PRO Posts: 148

All,

I am trying to develop a learning game based on physics (electric principles, etc) and im trying to figure out how to make certain tasks interactive. I am having trouble putting into words what i am trying to do which is making a forum search difficult so forgive me.

I would like to make a hanging ball that as a negatively charged rod is put closer to it the ball starts to move toward the rod, thus showing it has a positive charge. I understand tying one set of coordinates to the other but if i want one end to remain attached? and how do i do this based on the proximity of the rod?

Kind of like this. Any thoughts or where to start looking.


Thanks in advance

Comments

  • bob loblawbob loblaw Member, PRO Posts: 793

    use the magnitude function to determine the distance between the two, within a rule that says if that distance <= x, then do whatever you need it to do.

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772

    Here is a video I did about the Magnitude Function if you want to check it out.


  • Jeffm2Jeffm2 Member, PRO Posts: 148

    @jamie_c PERFECT!!!

  • Jeffm2Jeffm2 Member, PRO Posts: 148

    Wanted to thank everyone for their input and show what has been done so far. Its very flawed but I couldnt have gotten tis far without your help. Its not complete but gives you the iea of where its going.



  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772

    @Jeffm2, That's really cool. Seems like it's coming along nice. I completed the first task and it didn't move on to a second, I assume it's not programmed in yet but just in case I wanted to let you know.

  • Jeffm2Jeffm2 Member, PRO Posts: 148

    @jamie_c Right. Just the one so far

  • bob loblawbob loblaw Member, PRO Posts: 793

    that's pretty cool.

    seems to be a layering issue with the notebook and plastic rod though that takes away from the depth effect on the display.

Sign In or Register to comment.