Lem0nzzx
|
  |
| Joined: 08 Feb 2016 |
| Total Posts: 1604 |
|
|
| 07 Feb 2017 09:43 PM |
So I'm doing this for the first time, and it's kind of weird imo. I'm trying to figure out how I can make a player launch forwards or backwards with bodyforce, does anybody have a clue how I can do this?
Tips are always good | https://www.roblox.com/catalog/588125527/Tip |
|
|
| Report Abuse |
|
|
| |
|
|
| 07 Feb 2017 09:47 PM |
if it is a force local to the current direction
Vector3.new(x,y,-z)
if it is global (world space)
myCFrame:vectorToWorldSpace( Vector3.new(x,y,-z) ) --lookvector shifted locally by x,y,-z |
|
|
| Report Abuse |
|
|
Lem0nzzx
|
  |
| Joined: 08 Feb 2016 |
| Total Posts: 1604 |
|
|
| 07 Feb 2017 09:49 PM |
Help me please, I just want to know how to use lookvector correctly so I can make a knockback work.
Tips are always good | https://www.roblox.com/catalog/588125527/Tip |
|
|
| Report Abuse |
|
|
Lem0nzzx
|
  |
| Joined: 08 Feb 2016 |
| Total Posts: 1604 |
|
|
| 07 Feb 2017 09:52 PM |
You guys are confusing me all I'm trying to ask for is a way to make lookVector go backwards, so I can use a knockback script like this;
local bv = Instance.new("BodyVelocity") bv.P = 5000 bv.Velocity = Vector3.new(0,0,15) bv.MaxForce = Vector3.new(4000,4000,4000) bv.Parent = hit.Parent.Torso
the problem with this is that itll only go on the Z axis, meaning it needs to go directly behind where the torso is positioned. How can I do this?
Tips are always good | https://www.roblox.com/catalog/588125527/Tip |
|
|
| Report Abuse |
|
|
|
| 07 Feb 2017 09:53 PM |
'way to make lookVector go backwards'
are you serious lmao
-force
or
-lookVector |
|
|
| Report Abuse |
|
|
|
| 07 Feb 2017 09:54 PM |
also if you did not know this, lookvector is just a vector 1 stud in the direction in front of the cframe, so multiply it to get a stronger force
also definitely multiply by Vector3.new(1,0,1) so people don't do things like get knocked back into space unless it is from their own gun or something |
|
|
| Report Abuse |
|
|
Lem0nzzx
|
  |
| Joined: 08 Feb 2016 |
| Total Posts: 1604 |
|
|
| 07 Feb 2017 09:55 PM |
I'm using a bodyforce, and I want it to give the player a knockback effect. Isn't it true that you have to use lookVector to knock the player backwards?
Tips are always good | https://www.roblox.com/catalog/588125527/Tip |
|
|
| Report Abuse |
|
|
Lem0nzzx
|
  |
| Joined: 08 Feb 2016 |
| Total Posts: 1604 |
|
|
| 07 Feb 2017 09:56 PM |
Wunder I know that you can multiply it, I just need an example of how to do it using a bodyforce. help me please.
Tips are always good | https://www.roblox.com/catalog/588125527/Tip |
|
|
| Report Abuse |
|
|
|
| 07 Feb 2017 09:56 PM |
it isn't really a fact, it is just math
since force is global then you have to apply a local -> global force |
|
|
| Report Abuse |
|
|
XCVlll
|
  |
| Joined: 23 Oct 2008 |
| Total Posts: 963 |
|
|
| 07 Feb 2017 09:59 PM |
| if i remember it was something to do with lookVector and changing the velocity of the player's torso |
|
|
| Report Abuse |
|
|
Lem0nzzx
|
  |
| Joined: 08 Feb 2016 |
| Total Posts: 1604 |
|
|
| 07 Feb 2017 10:01 PM |
@XCVlll I know about this, but the problem is it doesn't even do it the way I want it to.
local bv = Instance.new("BodyVelocity") bv.P = 5000 bv.Velocity = script.Parent.CFrame.lookVector * 30 bv.MaxForce = Vector3.new(4000,4000,4000) bv.Parent = hit.Parent.Torso Maybe I should try;
local bv = Instance.new("BodyVelocity") bv.P = 5000 bv.Velocity = game.Players.LocalPlayer.Character.Torso.CFrame.lookVector * 30 bv.MaxForce = Vector3.new(4000,4000,4000) bv.Parent = hit.Parent.Torso
Tips are always good | https://www.roblox.com/catalog/588125527/Tip |
|
|
| Report Abuse |
|
|
Lem0nzzx
|
  |
| Joined: 08 Feb 2016 |
| Total Posts: 1604 |
|
|
| 07 Feb 2017 10:03 PM |
Works now, thanks for the help btw.
Tips are always good | https://www.roblox.com/catalog/588125527/Tip |
|
|
| Report Abuse |
|
|