Is it possible to keep the mouse from passing a certain point?

I have a moveable object colliding with a static object, a throwing line. When the mouse goes beyond the throwing line, while the moveable object stays below the line, all of the actions and behaviors I have set are ignored. My idea was to keep the mouse from going past the throw line. Can anyone help me figure out how to make that work or is there a better solution for this?

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Why are your behaviors not working when you are below the line? How are you constraining the actor?

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • huppertatorhuppertator Member Posts: 34
    Everything works when the mouse doesn't travel past the line. It's when the mouse goes beyond the line that the ball doesn't adhere to any behaviors.

    The moveable actor is constrained to the mouse until it is released. Another option I was throwing around was to make the mouse release if it collides with the line, but I'm not quite sure how to set that up either. Or -- could I set a max distance the mouse can be away from the ball?
  • huppertatorhuppertator Member Posts: 34
    I'm going to try this:
    but constrain the max y of the ball to the y position of the line.
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    I guess what I was asking is what conditions are you using to prevent the ball from "adhering to behaviors?" Do you mean actual behavior statements (e.g. Change Velocity) or just physics behaviors in the sense that it doesn't move/collide/etc.?

    If you like, post a download link to your project. I'm sure if we can see it in action we can come up with a solution.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • huppertatorhuppertator Member Posts: 34
    Scratch that...
    While testing this tutorial I tracked the speed of the ball. Turns out that the issue is not with the mouse but when the ball hits max speed (400). I'll post example.
  • huppertatorhuppertator Member Posts: 34
    How do I add a .zip file in here??
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Only moderators can do that. But you can upload your .zip file to a file-sharing service such as Dropbox and then post the download link here.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • huppertatorhuppertator Member Posts: 34
    edited March 2013
    https://dl.dropbox.com/u/76006391/throwing-test.zip
    not the actual game, but this demo shows exactly what's happening. the color changes are tracking size change and speed (red for over 350, green for width smaller than 75)
  • huppertatorhuppertator Member Posts: 34
    What I'm trying to accomplish is while the ball is touched (touch is pressed) it has to stay below the red line in the throwing area until touch is released. After that it should have a throwing arc with a trajectory following the path from the touch to release point. Then the ball is allowed to hit obstacles and a target. The problem is that once the ball is released and it seems it hits the point of max velocity (which is set at 400 but seems to happen at >= 350) it *sometimes* detects collisions but doesn't arc at all, it just keeps "floating" up at that velocity. I can't really figure out how to resolve this issue.
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    I probably won't be able to help with the velocity issue... hopefully someone else has an idea. I have noticed that at high velocity, actors tend to skip over collisions (e.g. with "walls").

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

Sign In or Register to comment.