|
| 04 Dec 2013 07:50 PM |
I'm trying to create a brick that when sliding on ice, you hit it and it doesn't make you bounce back but it stops you on the tile you are on. But after you hit it, you can freely move. You may be thinking that this is what bricks do but you are wrong. I'm developing a simple ice puzzle game ( Got the idea from the 7th Gym in Pokemon Platinum ) and I have 3 different tiles that make putting a level together extremely simple. The 3 tiles are an ice tile, what you slide on, a snow tile, flat like an ice tile but snow, and a snow boulder tile, a large sphere with a transparent brick surrounding it to stop a player. Whenever you slide into the brick, it bounces you back but I want to prevent this from happening. Changing the elasticity and such isn't working so I figured a script would.
Would I do something like creating a wield onTouch and then destroying the wielding after half of a second? Please help. |
|
|
| Report Abuse |
|
|
|
| 04 Dec 2013 07:55 PM |
I don't know if this would work but...
script.Parent.Touched:connect(function(hit) t = hit.Parent:FindFirstChild("Torso") t.Anchored = true wait(0.1) t.Anchored = false end)
|
|
|
| Report Abuse |
|
|
|
| 04 Dec 2013 07:57 PM |
| Just change the velocity of each part in the player to Vector3.new(0,0,0). Anchoring the player won't remove their starting velocity when they were anchored and they will continue to move when unanchored. |
|
|
| Report Abuse |
|
|
|
| 04 Dec 2013 08:00 PM |
| How do I do that? Cause the other one didn't work. |
|
|
| Report Abuse |
|
|
|
| 04 Dec 2013 08:06 PM |
Each brick has a property called "Velocity" which is a Vector3 value. cycle through all of the children in the character and if it is a part, change the velocity to Vector3.new(0,0,0).
On a side note: Know that you have to want to learn how to script rather than wanting the outcome of scripting. Do a little research and see how to do this -- you should at least know how to change properties before attempting to script. When you just get people to give you code, you don't learn. If you just want the outcome of scripting, that's perfectly fine, but know that you'll never be able to script anything complex. |
|
|
| Report Abuse |
|
|
|
| 04 Dec 2013 08:07 PM |
Ohh, that makes a lot more sense. Thanks.
|
|
|
| Report Abuse |
|
|
cxcharlie
|
  |
| Joined: 26 Aug 2009 |
| Total Posts: 1414 |
|
| |
|
|
| 05 Dec 2013 02:14 PM |
| I know how to change properties and do everything in workspace except scripting. The problem is that changing the properties did no work. |
|
|
| Report Abuse |
|
|
| |
|