|
| 20 Jul 2016 10:44 AM |
i want this brick named,"Effect" to be in front of the player i know this is the line of code thats messing up the output is clean shouldnt this work though?
line of code:
Effect.Position = plr.Character.Torso.CFrame.lookVector*1 |
|
|
| Report Abuse |
|
|
maxomega3
|
  |
| Joined: 11 Jun 2010 |
| Total Posts: 10668 |
|
|
| 20 Jul 2016 10:48 AM |
| That would be inside the player, since anything multiplied by one is itself. |
|
|
| Report Abuse |
|
|
|
| 20 Jul 2016 10:51 AM |
the brick is appearing behind me for some reason
|
|
|
| Report Abuse |
|
|
maxomega3
|
  |
| Joined: 11 Jun 2010 |
| Total Posts: 10668 |
|
|
| 20 Jul 2016 10:54 AM |
that's a bit odd. Are you sure you've got your torso on right?
So I forgot that the lookVector is the position directly in front of CFrame.p of the object. Since your problem is that the brick is slightly behind you, all you have to do is negate the lookVector value.
somethingyouwantinfrontofyou.Position = myTorso.CFrame.lookVector * -1 -- tweak the value as you please |
|
|
| Report Abuse |
|
|
|
| 20 Jul 2016 10:56 AM |
wait no, my bad,
the brick is appearing in one spot only(a fixed position) even if my torso faces another direction it just looked like it was behind me at that time i can post the whole script, but i doubt you would read it |
|
|
| Report Abuse |
|
|
maxomega3
|
  |
| Joined: 11 Jun 2010 |
| Total Posts: 10668 |
|
|
| 20 Jul 2016 11:03 AM |
Oh, well that's just a problem of you not updating your own torso's position! You need to have the position of the brick update when your torso moves by using a loop.
Given you have FE enabled, if you want yourself to only see the brick in front of you, you can use a local script and create a loop using RenderStepped, but likely you'll need to run it on the server side so everyone can see it. In that case, you can use an old fashioned while loop, or a possibly less expensive alternative of using a function that is connected to a change in your torso's position, but I'm not sure if changing position alerts the Changed event.
Good luck |
|
|
| Report Abuse |
|
|
|
| 20 Jul 2016 11:16 AM |
i got it fixed suprisingly
i just used CFrame instead of lookVector |
|
|
| Report Abuse |
|
|