I'm using my Camera as the origin for a Raycast Node that fires in the forward direction on on success it show dialogue HIT.
I also have the Raycast Node store the hit position Vector3 as Set mousePos Global Variable.

When I press play the dialogue HIT shows on my screen hovering over objects but when I go to check Makinom Vector3 Variables it shows mousePos at (0.0, 0.0, 0.0) as if it isn't being stored at all.

I'm trying to get the an object to move in my scene by clicking and dragging on them by using the above variable mousePos with a Change Position Node.

What am I doing wrong?
Please help!

Thanks
Portfolio - My Website
Follow my project on Reddit - My Game DevLog
relentingVids - My YouTube Channel
Half Super Shop - My Shop
  • Your description sounds correct, but I'd need to see the setup (e.g. screenshots of the schematic and raycast node) to tell you more.

    Since variable isn't set, be sure to check for spelling mistakes and if you're using the correct variable origin, or if the variable is changed somwhere else as well.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Image and video hosting by TinyPic">
    This is the Global Variable I made and the schematic on my object I want to move

    Image and video hosting by TinyPic">
    This is on my main camera and Hit Point Key mouseRayPos is from value
    Portfolio - My Website
    Follow my project on Reddit - My Game DevLog
    relentingVids - My YouTube Channel
    Half Super Shop - My Shop
  • Well, there it is - first image Change Variable 7 sets the mouseRayPos to 0, 0, 0.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • After messing around I just noticed that too and now it works! lol

    Thanks again GIL =]
    Portfolio - My Website
    Follow my project on Reddit - My Game DevLog
    relentingVids - My YouTube Channel
    Half Super Shop - My Shop
  • I'm coming back to Makinom after a long break, and I still have issues with drag functionality. What did you eventually configure "Change Variable 7" to be? Which other "gotchas" do I have to pay attention to?
  • OK, so I finally discovered how to do this properly without raycast.
    I'm writing this down for others who may find this challenging:

    Add Interaction Machine on the desired object and check "Mouse Drag"
    Create a new schematic with the following nodes:
    Mouse Touch Delta: set value to local variable 'mouseDelta'
    Vector3 Multiply:
    [variable settings]: set value to local variable 'posPoint'
    [vector3 value]: use local value of vector3 'mouseDelta'
    [multiply by]: value 0.01111
    Change Position:
    [position]: Set Axis X and Y (for 2d games) with X and Y local aspects of 'posPoint'
    [position]: math function negate Y axis to invert move direction
    [position]: check 'local position'






  • Nice I'll have to try that out.

    I'll post my schematic once I get some pics.
    Portfolio - My Website
    Follow my project on Reddit - My Game DevLog
    relentingVids - My YouTube Channel
    Half Super Shop - My Shop
  • Here is the way I went about doing this.
    Hope this helps anyone interested!
    =]
    My Tutorial For Mouse Dragging
    Portfolio - My Website
    Follow my project on Reddit - My Game DevLog
    relentingVids - My YouTube Channel
    Half Super Shop - My Shop
Sign In or Register to comment.