#how do i detect what direction a player is swiping relative to them?
1 messages · Page 1 of 1 (latest)
define "swiping"
do you need the detect direction of the swipe?
yeah
mb, didnt read post properly
the one wher u hit at 3/7 of something, right?
not sure you even need to detect direction of swipe for that, just detect if the hit is near the part of length
i want the line to be diffrent each time
it should be easy to just check the length of object for that
its for a player and idk how to do that ):
if the line is always vertical you just do {player head} - {the y level player is on, you can use "player get is grounded" chip for that}
that'll give you players height
then you just check if hit was at a specific distance relative to that height (so like the y level of collision should be (3*heigt)/7 if i remember the ability correctly)
yeah...
would you be ever so kind and try make a image of what that would like
sorry if its too much trouble ):
when you spawn a player (make sure to run only for local player) > float variable (name it "player height)
to that variable you connect:
player get head position > vector3 split (use y output for next steps) > subtract (1st input)
local player > get position (will get position at players feet) > vector3 split (use y output for next step) > subtract (the earlier one, 2nd input)
connect the output of subtract to the variable
that'll give you the players height
you can use that for other stuff
yep
now you just connect that variable to whatever you use to spawn player into the game
or you can connect it to "event receiver" (set event to Update30Hz)
that will check the height a lot of times per second keeping the height always somewhat accurate
how to i now get the 3 / 7 part
to get y level of 3/7 you just multiply that height by 3 and divide result by 7
epic
or just multiply by 0,4285714285714 (aprox. 3/7th)
crazy maths
calc
well you just have the y level of that 3/7th of height
oh
to detect a hit, you just check if hit positions y level is close to that
yeah
make sure to give some wiggle room for that cause its basically impossible to hit precisely at 3/7s even with hints
in the show nanami's ratio isnt just from head to toe
it can be diagonal like this also
well, you could make it work on enemy's limbs but thats more difficult to implement (the hit part at least)
yeah i dont really want to do that.
well, if you get players height only once, you could use that value for any rotation of player
but only situations when players are rotated diagonaly are when they're seated (f.e. when grabbed by other abilities)
if you're adding monsters, you just get the values once manually and clamp the ratio to stuff you want it to work
wdym by randomize
well, you could just subtract 3/7 from the height to get 4/7 (aka 3/7 from top)
and you can do method i walked about earlier (multiply and divide) for bottom 3/7
to randomize, you take two values, plug it into if value and then you just randomize the bool of that if value
and what would that look like...
to randomize bool you just use random int (1st input is 0, 1nd input is 1) and check if that int is equal to 1
the 3/7 into top and height-3/7 into bottom
and connect red from "equals" to the red intput of if value
then to get y level of the required height, you take that value and add it to y level of local player
this
then, when you hit someone, check from that someones perspective (aka they have to be the local player in your calculations, basically same as when you check damage stuff in almost all pvp systems) you just check if collision hit positions y level is same as that
this is making my brain hurt
welcome to cv2
fair enough
would you be oh so epic and amazing to build this in my room for me before i explode.
nope
poo
we are already at 80+ messages sent ):
there are multiple posts with like 1-2k messages
This channel is for teaching, learning, troubleshooting.
he knows, dw
half people who want cv2 just get too tired too fast
sorry chat
dw
at least you're not like 30% of users here who just say "do this, ill pay you" in #1020094893458198578
I do get a bit quick to get antsy at it sorry
all good
would it possible for you to build this in your room and send a pic so i can see where ive gone wrong because im kinda stuck.
are you fine with that?
im bout to go to best so kinda cant
#1374156524712366191 this could help
when aking anything, time is the only pric
its also late for me anyways
just practice and make stuff and you'll get better
ive been doing cv2 for 2+ years now
also, you probably dont have any deadline so dont stress it too much
tbh, it is just math and some small tricks
it goes over very basic stuff
cv2 is just programming so you can use tricks from regular programming
i feel like im being insulted ):
u dont really need to check exact position, u just gotta compare that 3/7 to y level oof hit position