NotAshley
|
  |
| Joined: 16 Jan 2014 |
| Total Posts: 14257 |
|
|
| 13 Feb 2015 10:54 PM |
I use this, and thought I'd share it. It's a bit of a rough guideline for creating tools (mainly weapons) with CFrame animated limbs, like Fenrier's. I use a HopperBin and a LocalScript, although you can substitute it for a tool if you change a few things.
--Assign variables to meshes, sounds, etc --CFrame interpolation function (i.e Stravant's) --Wait for character to load --Assign variables to player, character, limbs and default Motor6Ds --Assign special variable to RootJoint in HumanoidRootPart for rotating torso --Create variables for the default C0 and C1 limb welds (for easy non-relative rotating)
--Create a boolean "selected" variable (false) --Create a boolean "input_ready" variable (false) --Predefine variables for replacement limb welds
--Selected function ----Set selected variable to true ----If replacement limb welds exist, destroy them ----Create replacement limb welds in torso ----Detatch Part1 of default Motor6Ds ----Attach Part0 and Part1 of replacement welds ----Set C0 and C1 of replacement welds so they rotate like Motor6D limbs ----Make loop & animate welds and RootJoint to default equipped pose --------Break loop if selected is false ----Return if selected is false ----Set input_ready variable to true ----Listen for input and make stuff happen if input_ready is true
--Deselected function ----Set input_ready variable to false ----Set selected variable to false ----Make loop & animate welds and RootJoint to normal unequipped pose --------Break loop if selected is true ----Return if selected is true ----Destroy replacement welds ----Re attach default Motor6Ds |
|
|
| Report Abuse |
|
|
128GB
|
  |
| Joined: 17 Apr 2014 |
| Total Posts: 8056 |
|
|
| 13 Feb 2015 10:55 PM |
| you used so many -- it bothers me |
|
|
| Report Abuse |
|
|
NotAshley
|
  |
| Joined: 16 Jan 2014 |
| Total Posts: 14257 |
|
|
| 13 Feb 2015 10:59 PM |
@128GB sorry m8
it's meant to be copy/pasted into a script to act as a guideline (like a blueprent) |
|
|
| Report Abuse |
|
|
128GB
|
  |
| Joined: 17 Apr 2014 |
| Total Posts: 8056 |
|
|
| 13 Feb 2015 11:00 PM |
you still used too many --
--[[ hey how are you I'm on more than one line ]] |
|
|
| Report Abuse |
|
|
NotAshley
|
  |
| Joined: 16 Jan 2014 |
| Total Posts: 14257 |
|
| |
|
128GB
|
  |
| Joined: 17 Apr 2014 |
| Total Posts: 8056 |
|
|
| 13 Feb 2015 11:05 PM |
--[[ Assign variables to meshes, sounds, etc CFrame interpolation function (i.e Stravant's) Wait for character to load Assign variables to player, character, limbs and default Motor6Ds Assign special variable to RootJoint in HumanoidRootPart for rotating torso Create variables for the default C0 and C1 limb welds (for easy non-relative rotating)
Create a boolean "selected" variable (false) Create a boolean "input_ready" variable (false) Predefine variables for replacement limb welds
Selected function Set selected variable to true If replacement limb welds exist, destroy them Create replacement limb welds in torso Detatch Part1 of default Motor6Ds Attach Part0 and Part1 of replacement welds Set C0 and C1 of replacement welds so they rotate like Motor6D limbs Make loop & animate welds and RootJoint to default equipped pose Break loop if selected is false Return if selected is false Set input_ready variable to true Listen for input and make stuff happen if input_ready is true
Deselected function Set input_ready variable to false Set selected variable to false Make loop & animate welds and RootJoint to normal unequipped pose Break loop if selected is true Return if selected is true Destroy replacement welds Re attach default Motor6Ds ]] |
|
|
| Report Abuse |
|
|
NotAshley
|
  |
| Joined: 16 Jan 2014 |
| Total Posts: 14257 |
|
| |
|
NotAshley
|
  |
| Joined: 16 Jan 2014 |
| Total Posts: 14257 |
|
|
| 13 Feb 2015 11:13 PM |
--Create variables for the default C0 and C1 limb welds (for easy non-relative rotating)
^this was unclear, so let me clarify
when you rotate stuff with CFrame interpolation modules like Stravant's that ask for a start point and end point, the start point needs to have a full CFrame value even though you're only editing the rotation, and just using weld.C0 * CFrame.Angles(num,num,num) will rotate based on the current rotation and could mess stuff up if you're trying to make poses that can be switched to no matter what pose the character is currently in |
|
|
| Report Abuse |
|
|
NotAshley
|
  |
| Joined: 16 Jan 2014 |
| Total Posts: 14257 |
|
| |
|
NotAshley
|
  |
| Joined: 16 Jan 2014 |
| Total Posts: 14257 |
|
| |
|