Wrathsong
|
  |
| Joined: 05 Jul 2012 |
| Total Posts: 22393 |
|
|
| 27 Jun 2017 05:01 PM |
idk, the problem is that mobile users using a Harpoon tool in my game can tap on the screen to fire it but I can only get the X and Y positional values of their input
how can I get the Z value from this? i need it to visualize the beam
|
|
|
| Report Abuse |
|
|
vsnry
|
  |
| Joined: 03 Feb 2012 |
| Total Posts: 2143 |
|
|
| 27 Jun 2017 05:14 PM |
i've never done mobile input but i'm pretty sure mouse.Hit would still work on it
|
|
|
| Report Abuse |
|
|
WildGuest
|
  |
| Joined: 28 Feb 2010 |
| Total Posts: 647 |
|
|
| 27 Jun 2017 05:15 PM |
For my dig tool, I didn't do anything special for the mobile version.
|
|
|
| Report Abuse |
|
|
Wrathsong
|
  |
| Joined: 05 Jul 2012 |
| Total Posts: 22393 |
|
|
| 27 Jun 2017 05:17 PM |
UIS.TouchStarted:connect(function(input, gpe) if db then return end db = true --print('touch started', gpe, input.Position) spawn(function() ShootHarpoon(Vector3.new(input.Position. X, input.Position.Y, Mouse.Hit.p.z)) end) wait(1) db = false end) in the case of just doing ShootHarpoon(input.Position), Z was 0. I did it like this and it has a Z value now but still doesn't really work right. Maybe because it still thinks the mouse's position is where my thumb is on the thumbstick, not where I'm tapping in the middle of the screen
|
|
|
| Report Abuse |
|
|
Wrathsong
|
  |
| Joined: 05 Jul 2012 |
| Total Posts: 22393 |
|
|
| 27 Jun 2017 05:18 PM |
@wild perhaps your players aren't usually moving while they are mining though? my players are usually going to be moving while they shoot the harpoon
|
|
|
| Report Abuse |
|
|
Wrathsong
|
  |
| Joined: 05 Jul 2012 |
| Total Posts: 22393 |
|
|
| 27 Jun 2017 05:22 PM |
ok sorry i was typing out a big long post originally but then restarted it
the problem is that when players are moving with the thumbstick and they try to shoot, the mouse, i think, is counted as still being where the thumbstick is, not where i tapped in the middle of the screen while my thumb is on the thumbstick
|
|
|
| Report Abuse |
|
|
Wrathsong
|
  |
| Joined: 05 Jul 2012 |
| Total Posts: 22393 |
|
| |
|
vivivio
|
  |
| Joined: 23 Jan 2012 |
| Total Posts: 707 |
|
|
| 27 Jun 2017 05:42 PM |
| use the TouchTap event instead |
|
|
| Report Abuse |
|
|
Wrathsong
|
  |
| Joined: 05 Jul 2012 |
| Total Posts: 22393 |
|
|
| 27 Jun 2017 05:43 PM |
I started out using TouchTap but it didn't fire when I tapped in the middle of the screen while my other hand's thumb was already on the thumbstick
|
|
|
| Report Abuse |
|
|
vivivio
|
  |
| Joined: 23 Jan 2012 |
| Total Posts: 707 |
|
| |
|
ReaIG
|
  |
| Joined: 10 Apr 2017 |
| Total Posts: 4021 |
|
| |
|
Wrathsong
|
  |
| Joined: 05 Jul 2012 |
| Total Posts: 22393 |
|
|
| 27 Jun 2017 05:47 PM |
i was using a debounce. touchtap *doesnt fire* when i tap with one finger while another finger is already down
|
|
|
| Report Abuse |
|
|
vivivio
|
  |
| Joined: 23 Jan 2012 |
| Total Posts: 707 |
|
|
| 27 Jun 2017 05:48 PM |
| no I mean use a debounce with TouchStarted, sorry for the confusion |
|
|
| Report Abuse |
|
|
vivivio
|
  |
| Joined: 23 Jan 2012 |
| Total Posts: 707 |
|
|
| 27 Jun 2017 05:49 PM |
| oh wait you did that... ripme |
|
|
| Report Abuse |
|
|
Wrathsong
|
  |
| Joined: 05 Jul 2012 |
| Total Posts: 22393 |
|
|
| 27 Jun 2017 05:54 PM |
qq
yeah with mouse.Hit.p.Z I get a value for Z but the code to visualize the beam just doesn't work. maybe its because the Z value doesn't quite align with the X and Y values, i dont know
|
|
|
| Report Abuse |
|
|
WildGuest
|
  |
| Joined: 28 Feb 2010 |
| Total Posts: 647 |
|
|
| 27 Jun 2017 05:57 PM |
What's your script? I just went to test if I can dig while walking on mobile and I can. I think it's just the way the script is made.
|
|
|
| Report Abuse |
|
|
WildGuest
|
  |
| Joined: 28 Feb 2010 |
| Total Posts: 647 |
|
|
| 27 Jun 2017 05:59 PM |
Oh theres the script. I'd just use mouse.Hit.p
|
|
|
| Report Abuse |
|
|
Wrathsong
|
  |
| Joined: 05 Jul 2012 |
| Total Posts: 22393 |
|
|
| 27 Jun 2017 06:01 PM |
/HZuxtwJw server code; you already see my client code above
/foy9xf lightshot - this is the server output - it prints the vector3 received, so i don't know whats up
|
|
|
| Report Abuse |
|
|
Wrathsong
|
  |
| Joined: 05 Jul 2012 |
| Total Posts: 22393 |
|
|
| 27 Jun 2017 06:02 PM |
"the problem is that when players are moving with the thumbstick and they try to shoot, the mouse, i think, is counted as still being where the thumbstick is, not where i tapped in the middle of the screen while my thumb is on the thumbstick"
the reason i dont use mouse.hit.p ^
|
|
|
| Report Abuse |
|
|
Wrathsong
|
  |
| Joined: 05 Jul 2012 |
| Total Posts: 22393 |
|
|
| 27 Jun 2017 06:06 PM |
eeeeeeuuuuuuuuggggghhhhhhhhhh
ok disregard this thread, apparently it only happens sometimes when i start moving with the thumbstick then immediately try to shoot right after i guess
|
|
|
| Report Abuse |
|
|