Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | SandmanIvan | |
Old Version | Published before Godot 3 was released. |
This problem seems to be a lot harder in concept than it should be.
The Goal:
to have it where in the game the player can use their mouse to click, drag, drop tile pieces.
Nodes:
KinematicBody2D > Sprite & CollisionShape2D
Script: 1 on KinematicBody2D
Pastebin Link to script
With all of this I thought I had it:
- The program is checking my Mouse Position and able to store it as a Vector2
- Check if LMB & Cursor are in the same place
- move an object anywhere.
It slightly does. the problem is the LMB has to be on first before touching the object
and when it does move its only in a small incremental burst in the almost random direction slightly influenced by the mouse movement.
I have no idea where to go from here. If someone has a better idea, a guide, hint or something pleese I could really use it.
Did you set the KinematicBody2D as pickable
? Maybe it helps
genete | 2016-05-30 21:51
Yes, I did. I had figured that would be one thing that would show up.
Just in case here is my project folder, it just uses the default icon.
https://drive.google.com/file/d/0B0iEQfbunEIFNVpzVlZEUGkxZUE/view?usp=sharing
SandmanIvan | 2016-05-30 22:01
So on another post, I was given some help.
Changed:
_process :: _fixed_process
set_process :: set_fixed_process
self.set_pos(Mpos) :: self.set_global_pos(Mpos)
(I can also just remove self. from that to as its not nesserary)
Unfortunately, this still didn’t help. I took a Gif capture of what the game is doing here:
Want to point out that my Left Mouse Button is held down the whole time to get it to move at all.
SandmanIvan | 2016-05-31 01:09