Lem0nzz
|
  |
| Joined: 18 Jul 2011 |
| Total Posts: 926 |
|
|
| 01 Jun 2014 09:13 PM |
| How do you make a pushback effect? Like when a player uses a kick move, how do you make it push the player back, and can you choose what distance? |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 01 Jun 2014 09:16 PM |
| For the distance, you can use -torso.CFrame.lookVector and you can push the player back by setting the velocity to that times some number |
|
|
| Report Abuse |
|
|
|
| 01 Jun 2014 09:16 PM |
Here's a snippet of what I was working on:
Target.Velocity = Direction.CFrame.lookVector * 50
--Target being what you want pushed back, Direction being the direction it is pushed
Not really distance per se, but you can play with the numbers to produce desired results. |
|
|
| Report Abuse |
|
|
Infocus
|
  |
| Joined: 28 Apr 2011 |
| Total Posts: 8022 |
|
|
| 01 Jun 2014 09:17 PM |
If youre making a move, Id use magnitude instead of .Touched to get a players torso.
torso.Velocity = torso.CFrame.lookVector*-30
Idk |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 01 Jun 2014 09:19 PM |
| Knight, I meant the guy who got kicked's lookVector but I just realized that makes no sense and your way is much better. |
|
|
| Report Abuse |
|
|
|
| 01 Jun 2014 09:23 PM |
| I actually got it, lol. Might have been a little over the OP's head since it's pretty new to him though. |
|
|
| Report Abuse |
|
|
Lem0nzz
|
  |
| Joined: 18 Jul 2011 |
| Total Posts: 926 |
|
|
| 01 Jun 2014 10:54 PM |
| So to connect it so the leg makes the pushback, would you use "hit.Character"? |
|
|
| Report Abuse |
|
|
|
| 01 Jun 2014 10:56 PM |
assuming things are defined, something like:
hit.Parent.Torso.Velocity = Leg.CFrame.lookVector * 50
|
|
|
| Report Abuse |
|
|
Lem0nzz
|
  |
| Joined: 18 Jul 2011 |
| Total Posts: 926 |
|
|
| 01 Jun 2014 10:59 PM |
| Hmm... Sounds legit, thanks! |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 01 Jun 2014 11:04 PM |
| Isn't the leg's (and arm's) lookVectors the -y direction while the torso and head is the -z direction? I'm not sure about the leg's and arm's but to be safe you can use the Torso's lV |
|
|
| Report Abuse |
|
|
Lem0nzz
|
  |
| Joined: 18 Jul 2011 |
| Total Posts: 926 |
|
|
| 01 Jun 2014 11:10 PM |
| So you're saying instead of leg, torso? |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 01 Jun 2014 11:12 PM |
| Probably, I've never actually checked but I'm assuming the legs and arms are rotated 180 degrees on the z-axis |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
| |
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 01 Jun 2014 11:16 PM |
| God I'm messing up a lot, 90 degrees on the x-axis |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
| |
|
Lem0nzz
|
  |
| Joined: 18 Jul 2011 |
| Total Posts: 926 |
|
|
| 01 Jun 2014 11:22 PM |
| I don't get what you're talking about here.. Lol, all I'm asking for is if the players leg, that was going to kick the opponent's body how would I make it connect, to the pushback effect? |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 01 Jun 2014 11:23 PM |
| Just use what he gave you, but if they get pushed differently than use the Torso |
|
|
| Report Abuse |
|
|
|
| 01 Jun 2014 11:27 PM |
| torso.Velocity = torso.CFrame.lookVector*-50 |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 01 Jun 2014 11:29 PM |
| It's not a good idea to do it that way island because you are assuming they are being kicked directly infront of the person. |
|
|
| Report Abuse |
|
|
|
| 01 Jun 2014 11:40 PM |
ohh, I thought you meant when the player is kicking, not when the player gets kicked..
leg.Touched:connect(function(h) h.Velocity = leg.CFrame.lookVector*100 end)
something like that? might need to be rotated, or something |
|
|
| Report Abuse |
|
|
Lem0nzz
|
  |
| Joined: 18 Jul 2011 |
| Total Posts: 926 |
|
|
| 02 Jun 2014 12:45 AM |
| Ok thanks, and just to make sure, it's "Right Leg", or "Left Leg", not leg right? leg could just be a variable? |
|
|
| Report Abuse |
|
|