crazyblox
|
  |
| Joined: 16 Mar 2008 |
| Total Posts: 6139 |
|
|
| 25 Oct 2011 02:44 PM |
| Moving with CFrames repeatedly doesnt work with .Touched, any help/ideas? |
|
|
| Report Abuse |
|
|
crazyblox
|
  |
| Joined: 16 Mar 2008 |
| Total Posts: 6139 |
|
| |
|
|
| 25 Oct 2011 03:10 PM |
The best way to move a brick that can still trigger. Touched events is:
function OnTouch()
script.Parent.Parent.EXAMPLE.position(MoveTo:workspace.EXAMPLE2.position.)
end
script.Parent.Touched:Connect(OnTouch) |
|
|
| Report Abuse |
|
|
crazyblox
|
  |
| Joined: 16 Mar 2008 |
| Total Posts: 6139 |
|
|
| 25 Oct 2011 03:18 PM |
that just moves it to one spot and i believe you read it wrong.
Ima see if i can make this more clear;
i want a method of movement that can let an anchored brick trigger .Touched Events during its movement.
The movement of the brick is controlled by a seperate script and i am keeping it that way, because the brick that moves contains a particular script of which uses .Touched and that is why im asking for help.
Stuff like bodyforce or bodyvelocity or what? I need to be pointed in the right direction. |
|
|
| Report Abuse |
|
|
crazyblox
|
  |
| Joined: 16 Mar 2008 |
| Total Posts: 6139 |
|
| |
|
crazyblox
|
  |
| Joined: 16 Mar 2008 |
| Total Posts: 6139 |
|
|
| 25 Oct 2011 03:51 PM |
1 Hour and 10 Minutes. Well, near enough. |
|
|
| Report Abuse |
|
|
|
| 25 Oct 2011 04:02 PM |
| So you want to know when that brick that is being moved hits another object... Just move the brick with velocity. |
|
|
| Report Abuse |
|
|
crazyblox
|
  |
| Joined: 16 Mar 2008 |
| Total Posts: 6139 |
|
| |
|
|
| 25 Oct 2011 05:35 PM |
Magnitude.
while wait() do players = game.Players:GetChildren() for i=1,#players do if players[i].Character then if (players[i].Character.Torso.Position - script.Parent.Position).magnitude <= 10 then print("PlayerNear") --Probably will print ALOT of times.. so I would make a halt system end end end end |
|
|
| Report Abuse |
|
|
crazyblox
|
  |
| Joined: 16 Mar 2008 |
| Total Posts: 6139 |
|
|
| 25 Oct 2011 05:37 PM |
I dont think thats a Touched event. That isnt the kind of purpose im using this for either. Nice thinking though. |
|
|
| Report Abuse |
|
|
crazyblox
|
  |
| Joined: 16 Mar 2008 |
| Total Posts: 6139 |
|
|
| 25 Oct 2011 05:41 PM |
| Are there any other Pro's here to help me? |
|
|
| Report Abuse |
|
|
|
| 25 Oct 2011 05:43 PM |
| .Touched doesn't work on a moving block. If you use magnitude and un anchore it in the position then call the function it will work. |
|
|
| Report Abuse |
|
|
crazyblox
|
  |
| Joined: 16 Mar 2008 |
| Total Posts: 6139 |
|
|
| 25 Oct 2011 05:46 PM |
But im not using the block for killing players or even detecting them. and whats the point of Touched if it doesnt work while moving? Btw, i tried it the other way round, still didnt work.
script.Parent.Touched:connect(function(hit) if hit.Name == "Fall" then print("Sinksinksinksinksinksink") hit.BrickColor = BrickColor.new("Dark Orange") wait(.3) hit.BrickColor = BrickColor.new("Bright Orange") wait(.3) hit.BrickColor = BrickColor.new("Bright Red") wait(.3) hit.BrickColor = BrickColor.new("Really Red") wait(.3) for fall=0,40 do hit.CFrame = hit.CFrame - Vector3.new(0,1.2,0) wait(.1) end end end) |
|
|
| Report Abuse |
|
|
crazyblox
|
  |
| Joined: 16 Mar 2008 |
| Total Posts: 6139 |
|
|
| 25 Oct 2011 05:54 PM |
| Bump of TryingToFixForDaysSrsly |
|
|
| Report Abuse |
|
|
crazyblox
|
  |
| Joined: 16 Mar 2008 |
| Total Posts: 6139 |
|
| |
|
crazyblox
|
  |
| Joined: 16 Mar 2008 |
| Total Posts: 6139 |
|
|
| 25 Oct 2011 06:15 PM |
If .Touched doesnt work while the brick is moving, Then how does a rocket work?
Oh yeah, Bump of Quarter-Past Midnight. |
|
|
| Report Abuse |
|
|
crazyblox
|
  |
| Joined: 16 Mar 2008 |
| Total Posts: 6139 |
|
| |
|
|
| 25 Oct 2011 06:24 PM |
.Touched will work on a moving brick, but not when it's moved by CFrame. :l
Your best bet would probably be to try to find a way to unanchor it and still accomplish your task instead.
"I WILL GIVE YOU BACON." - Deadmau5 ~Scarfacial |
|
|
| Report Abuse |
|
|
|
| 25 Oct 2011 11:20 PM |
| Good point. Bodyposition would work nice |
|
|
| Report Abuse |
|
|