Announcement

Collapse
No announcement yet.

Object that follows mouse position. How to properly do it with BP?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Object that follows mouse position. How to properly do it with BP?

    I try to make simple BP where my actor object will follow mouse position. So I've done it with the simple BP:
    Click image for larger version

Name:	4bc95bfc3292.png
Views:	1
Size:	157.2 KB
ID:	1152077

    but when I run it I get some "inverted" position of my actor. Why is it work like this?


    #2
    Why MouseLocationToWorldSpace returns something different from really converted mouse location to world space?
    Last edited by OrchestralMusician; 06-21-2015, 02:41 PM.

    Comment


      #3
      How to fix this?

      Comment


        #4
        I'm no expert, but it may have something to do with you multiplying the world direction by the world location, in one of my games, I do something similar for a line trace to mouse position. I just do a "Get hit result under cursor, and get the location from the hit.
        Marketplace Assets

        Advanced Mobile Input: Marketplace Page | Support Thread ――― Easy Input Remapping: Marketplace Page | Support Thread
        Multiplayer Blueprint Chat System: Marketplace Page | Support Thread ――― Closing Credits System: Marketplace Page | Support Thread
        Minesweeper Template: Marketplace Page | Support Thread ――― Maze Creator: Marketplace Page | Support Thread

        Comment


          #5
          Originally posted by Jamendxman3 View Post
          I'm no expert, but it may have something to do with you multiplying the world direction by the world location, in one of my games, I do something similar for a line trace to mouse position. I just do a "Get hit result under cursor, and get the location from the hit.
          This works. I'm making a tower defense, and here's what I have:
          Attached Files

          Comment


            #6
            Originally posted by Haxxer View Post
            This works. I'm making a tower defense, and here's what I have:
            Get HitResult almost works but what if you click two or more times in the same point? I have:

            Comment


              #7
              Originally posted by OrchestralMusician View Post
              Get HitResult almost works but what if you click two or more times in the same point? I have:
              That's simple, the first time you clicked, you clicked on the surface, the clicks after that were clicking on the sphere itself. The problem is that it doesn't seem to have an 'Actors to ignore' input, so is it possible that you can turn off collision for the sphere? Maybe there is a collision option that just ignores line traces and 'hits'?
              Marketplace Assets

              Advanced Mobile Input: Marketplace Page | Support Thread ――― Easy Input Remapping: Marketplace Page | Support Thread
              Multiplayer Blueprint Chat System: Marketplace Page | Support Thread ――― Closing Credits System: Marketplace Page | Support Thread
              Minesweeper Template: Marketplace Page | Support Thread ――― Maze Creator: Marketplace Page | Support Thread

              Comment


                #8
                Originally posted by Jamendxman3 View Post
                is it possible that you can turn off collision for the sphere? Maybe there is a collision option that just ignores line traces and 'hits'?
                But what if I want to drag and drop game Character? I need a collision for it
                Is there a way to detect in Level Blueprint if mouse location currectly places on an Actor?

                I applied Event: OnClicked (BallActorBP) - but it never calls in Level Blueprint.
                But Event: OnBeginCursorOver (BallActorBP) - works. Why?
                Last edited by OrchestralMusician; 06-22-2015, 02:34 AM.

                Comment


                  #9
                  Originally posted by OrchestralMusician View Post
                  But what if I want to drag and drop game Character? I need a collision for it
                  Is there a way to detect in Level Blueprint if mouse location currectly places on an Actor?

                  I applied Event: OnClicked (BallActorBP) - but it never calls in Level Blueprint.
                  But Event: OnBeginCursorOver (BallActorBP) - works. Why?
                  I'm not sure, but I guess I've helped as much as I know how in this thread, hopefully someone can point you in the right direction as far as ignoring the sphere when getting result under cursor.
                  Marketplace Assets

                  Advanced Mobile Input: Marketplace Page | Support Thread ――― Easy Input Remapping: Marketplace Page | Support Thread
                  Multiplayer Blueprint Chat System: Marketplace Page | Support Thread ――― Closing Credits System: Marketplace Page | Support Thread
                  Minesweeper Template: Marketplace Page | Support Thread ――― Maze Creator: Marketplace Page | Support Thread

                  Comment

                  Working...
                  X