|
| 01 Oct 2013 04:24 PM |
| So just thinking ive assumed that since it has to do with basic properties it must be easy.. But for the life of me i dont know how to do it. I need a wall in the middle of game that only bullets can pass through, to make sure players are stuck on one side of the playing field. Its just the way it is. From looking at Vip doors roblox created, they just teleport the item to the other side if its named a certain thing. WELL i want to know if thats the only way, or is it possible to make the CanCollide true for some things and false for others at the same time? Im not asking for a script, im just asking for scripting answers to set me in the right direction. Thnaks in advance guys. |
|
|
| Report Abuse |
|
|
adark
|
  |
| Joined: 13 Jan 2008 |
| Total Posts: 6412 |
|
|
| 01 Oct 2013 04:25 PM |
| A method you could use is to make the wall non CanCollide, and have it apply a backwards-pushing force to any player trying to pass through it. |
|
|
| Report Abuse |
|
|
|
| 01 Oct 2013 04:27 PM |
| Agh thats a really good idea! I never thought of using forces... Well ill try out the teleport method, and if it doesnt strike my fancy im feeling pretty good about your idea! |
|
|
| Report Abuse |
|
|
adark
|
  |
| Joined: 13 Jan 2008 |
| Total Posts: 6412 |
|
|
| 01 Oct 2013 04:28 PM |
| Another method is using a Raycast-powered bullet, which would cast a ray in whatever motion you want, and have it ignore the CanCollide wall. |
|
|
| Report Abuse |
|
|
|
| 01 Oct 2013 04:30 PM |
| That is true, and i thought of using raycasting before, however my game implies a large use of grenades and RPG's, so you sort of need to see the bullets. However i do believe it is possible to make rays visible along their path? Im not sure. I havent looked into raycasting more than the basics. |
|
|
| Report Abuse |
|
|
|
| 01 Oct 2013 04:31 PM |
You could also choose to activate CanCollide whenever something that isn't a bullet touches it, such as a players' arm, or a piece of debris.
Could be easily exploited if your level isn't built well enough, but it should work alright.
:/ |
|
|
| Report Abuse |
|
|
adark
|
  |
| Joined: 13 Jan 2008 |
| Total Posts: 6412 |
|
|
| 01 Oct 2013 04:33 PM |
Technically raycasts are not actual *things*, just a bunch of math, but what you can do is do them in an arc. I.e., you would make a function that would determine your projectile's motion through space at any given time t, and raycast from the current position to the next time step. You can make this step as large or as small as you want, but more raycasts mean more lag, so keep that in mind.
Once you have that, just do a CFrame interpolation from point A to point B and you're done. If the bullet were to collide with something, just make that the endpoint. |
|
|
| Report Abuse |
|
|
Xelia4
|
  |
| Joined: 19 Jul 2012 |
| Total Posts: 512 |
|
|
| 01 Oct 2013 04:33 PM |
If your weapons use CFrame, then it should be able to go right through the part. such as Manofthelol's weapons.
but for grenades and rockets (explosives), that's different. |
|
|
| Report Abuse |
|
|
|
| 01 Oct 2013 04:36 PM |
| Thanks for the info guys. But one question, to use the force idea posted right after my question.. Would i just change the velocity of the player momentarily to push them away, or should i apply a bodyforce to them and allow that to push them back a bit? |
|
|
| Report Abuse |
|
|
adark
|
  |
| Joined: 13 Jan 2008 |
| Total Posts: 6412 |
|
|
| 01 Oct 2013 04:36 PM |
| Either or, as far as I know, both methods work, but using a ForceObject is probably safer. |
|
|
| Report Abuse |
|
|
| |
|
|
| 01 Oct 2013 04:42 PM |
| Agh, actually i apolgize, and i could test this for myself, but this saves time. So would i place the forceobject within the torso of the character? Or does it work within the "Character" model itself? |
|
|
| Report Abuse |
|
|
adark
|
  |
| Joined: 13 Jan 2008 |
| Total Posts: 6412 |
|
|
| 01 Oct 2013 04:46 PM |
| Not sure, I haven't worked with forces since fixing up Kiseki, but try in the Torso. |
|
|
| Report Abuse |
|
|
| |
|