Grab and Throw actor from anywhere in game

I want to be able to grab my main actor and throw him where every he is at in the game. Currently i can grab and throw the actor but each time i go to grab him he tries to jump back to the same place in the map where he started. I want it so when i grab the actor it doesn't try to relocate anywhere, i want it to just stay where i am touching (clicking) and be thrown from that point. How do i do this?

Comments

  • scottharrrules43scottharrrules43 Tulsa, OklahomaMember, PRO Posts: 694
    edited April 2014

    Look for a template at gs helper
    Or here is a video

  • TyDietrichTyDietrich Member Posts: 45

    Okay so i got that working kind of, but there's something missing from that video. I need a when touch is released rule i believe but I'm not sure what attributes or behaviors i should have in the "if touch is released rule"

  • SocksSocks London, UK.Member Posts: 12,822

    Not sure you need all those attributes and rules, You can do it much more simply, like this . . .

    constrain velocity X to 10 * ( game.Mouse.Position.X - self.Position.X )

    constrain velocity Y to 10 * ( game.Mouse.Position.Y - self.Position.Y )

    . . . . hold on, time for a demo . . .

  • SocksSocks London, UK.Member Posts: 12,822

    Here you go - a simpler version:

    link: https://www.mediafire.com/?4896zj4n5loykky

  • TyDietrichTyDietrich Member Posts: 45

    exactly what i was looking for, thank you

Sign In or Register to comment.