|
| 27 Dec 2015 09:36 PM |
| How would I determine a player's downward direction? For example, when a player gets rotated sideways, I want a script that determines what direction is down. Can anyone help? |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 27 Dec 2015 09:41 PM |
local downDir = torso.CFrame:vectorToWorldSpace(Vector3.new(0, -1, 0)); That'll be "his down"
The "real down" is just Vector3.new(0, -1, 0); |
|
|
| Report Abuse |
|
|
|
| 27 Dec 2015 10:05 PM |
Thanks, but can I use it in place of vector3?
part.Velocity = Vector3.new(0, -1, 0)
to
part.Velocity = torso.CFrame:vectorToWorldSpace(Vector3.new(0, -1, 0)) |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
| |
|
|
| 27 Dec 2015 10:17 PM |
| Thank you! You are an amazing scripter! |
|
|
| Report Abuse |
|
|
|
| 28 Dec 2015 04:16 PM |
I also need my weapon to work when the player is turned, but Roblox velocity always turns the bullet around and makes it go to the real down. How would I make the bullet go to the "new" down?
P.S. I am testing it with Roblox's paintball gun, so if you want you can test it too |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 28 Dec 2015 04:59 PM |
Cancel out the acceleration due to gravity: Instance.new("BodyForce", part).force = Vector3.new(0, part:GetMass() * 196.2, 0)
And it won't affect it. If you want gravity to be applied to the new 'down', do what I did above but set the force to the down direction (and multiply by 196.2 * mass)
so like .force = downDir * part:GetMass() * 196.2 |
|
|
| Report Abuse |
|
|
|
| 28 Dec 2015 05:30 PM |
| When I shoot it, it goes down in the right direction, but it just goes straight down. I need it to make an arc and fall faster based on how high I shoot it. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 28 Dec 2015 05:31 PM |
It already will.
You want the bullet to shoot in the downward direction and emulate gravity on its down direction and ignore the "real" gravity, right? |
|
|
| Report Abuse |
|
|
|
| 28 Dec 2015 06:29 PM |
| I don't want it to go straight down right away, I need it to make an arc by going up first and then fall down. |
|
|
| Report Abuse |
|
|