generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Vector3.Z from a Vector2..?

Previous Thread :: Next Thread 
Wrathsong is online. 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 is not online. 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 is not online. 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 is online. 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 is online. 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 is online. 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 is online. Wrathsong
Joined: 05 Jul 2012
Total Posts: 22393
27 Jun 2017 05:39 PM
eeeeuuuuuuggggghhhhh


Report Abuse
vivivio is online. vivivio
Joined: 23 Jan 2012
Total Posts: 707
27 Jun 2017 05:42 PM
use the TouchTap event instead
Report Abuse
Wrathsong is online. 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 is online. vivivio
Joined: 23 Jan 2012
Total Posts: 707
27 Jun 2017 05:46 PM
use a debounce
Report Abuse
ReaIG is not online. ReaIG
Joined: 10 Apr 2017
Total Posts: 4021
27 Jun 2017 05:46 PM
this lil noob fr
Report Abuse
Wrathsong is online. 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 is online. 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 is online. vivivio
Joined: 23 Jan 2012
Total Posts: 707
27 Jun 2017 05:49 PM
oh wait you did that... ripme
Report Abuse
Wrathsong is online. 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 is not online. 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 is not online. 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 is online. 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 is online. 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 is online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image