generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Wall that only some things can pass through

Previous Thread :: Next Thread 
sunday1520 is not online. sunday1520
Joined: 23 Aug 2012
Total Posts: 693
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 is not online. 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
sunday1520 is not online. sunday1520
Joined: 23 Aug 2012
Total Posts: 693
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 is not online. 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
sunday1520 is not online. sunday1520
Joined: 23 Aug 2012
Total Posts: 693
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
stickmanx25 is not online. stickmanx25
Joined: 17 Aug 2007
Total Posts: 5829
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 is not online. 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 is not online. 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
sunday1520 is not online. sunday1520
Joined: 23 Aug 2012
Total Posts: 693
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 is not online. 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
sunday1520 is not online. sunday1520
Joined: 23 Aug 2012
Total Posts: 693
01 Oct 2013 04:38 PM
Thanks a ton!
Report Abuse
sunday1520 is not online. sunday1520
Joined: 23 Aug 2012
Total Posts: 693
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 is not online. 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
xXxMoNkEyMaNxXx is not online. xXxMoNkEyMaNxXx
Joined: 03 Oct 2008
Total Posts: 3120
01 Oct 2013 04:48 PM
Torso
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image