Touch x,y issues.

RabidParrotRabidParrot Formally RabidParrot.Member Posts: 956
edited April 2015 in Working with GS (Mac)

Hey Guys,

Does anyone know if changing the scene size or camera origin has an affect on the position of an actor?

My issues is that when this 'Potion' is touched it is supposed to fall. But, for some reason the screen or application doesn't recognize my finger. My rule and logic are correct. Additionally, the actor also has a linear velocity x > 300. I'm just curious as to if the speed of the actor and the size of the screen are able to throw touch coordinates off.

For those who would like to see my logic:

When touch is pressed

change attribute self.motion.linearvelocity.y to -200

That's it.

Comments

  • SummationSummation Member, PRO Posts: 476

    @RabidParrot I would say test it by making an actor display your potion's X and Y position for various resolutions.

  • RabidParrotRabidParrot Formally RabidParrot. Member Posts: 956

    I'll probably just have a touch actor that constrains it's y and x to the touch y an x

    when y and x are > 0.

    Just was curious if anyone else had this issue.

  • LovejoyLovejoy Member Posts: 2,078

    @RabidParrot said:
    Hey Guys,

    Does anyone know if changing the scene size or camera origin has an affect on the position of an actor?

    My issues is that when this 'Potion' is touched it is supposed to fall. But, for some reason the screen or application doesn't recognize my finger. My rule and logic are correct. Additionally, the actor also has a linear velocity x > 300. I'm just curious as to if the speed of the actor and the size of the screen are able to throw touch coordinates off.

    For those who would like to see my logic:

    When touch is pressed

    change attribute self.motion.linearvelocity.y to -200

    That's it.

    So if i understand correctly, you have a potion that flies from left to right, if you tap it its suppose to fall down? And its doing nothing at all when touched, just keeps going right?

    Are you switching the linear velocity x to 0 when touched? So it doesn't keep going right.

    Fortuna Infortuna Forti Una

  • RabidParrotRabidParrot Formally RabidParrot. Member Posts: 956
    edited April 2015

    @Lovejoy said:
    Are you switching the linear velocity x to 0 when touched? So it doesn't keep going right.

    Well not entirely, but that's all the logic that mattered. The potion goes left to right. When it is tapped it falls down. Then after a period of time it plays a sound and destroys. The last part doesn't really affect whether or not the touch works.

    No, I didn't change the x velocity.

    There are a couple interpolate behaviors too.

  • LovejoyLovejoy Member Posts: 2,078

    @RabidParrot Well there is no reason why touch is pressed shouldn't work other than... wait for it... something wrong in your code... gasp! :D

    Perhaps there is some type of conditions conflicting with each other. If you want me to take a look at it just strip your project and send me a PM.

    Fortuna Infortuna Forti Una

  • RabidParrotRabidParrot Formally RabidParrot. Member Posts: 956

    @Lovejoy said:
    RabidParrot Well there is no reason why touch is pressed shouldn't work other than... wait for it... something wrong in your code... gasp! :D

    Perhaps there is some type of conditions conflicting with each other. If you want me to take a look at it just strip your project and send me a PM.

    Impossible! I've never made a mistake! Mostly...

Sign In or Register to comment.