Modules(centerPoint, materials, occupancies, resolution, selectionSize, strength, desiredMaterial, brushShape, minBounds, maxBounds) Air then -dig ZĭesiredMaterial = isDynamic and nearMaterial or materialDictionary Local middle = materials -This little section of code sets nearMaterial to middle of matrix Local materials, occupancies = terrain: ReadVoxels(region, resolution) y + radius) / resolution), math.ceil((centerPoint. x + radius) / resolution), math.ceil((centerPoint. y - radius) / resolution), math.floor((centerPoint. x - radius) / resolution), math.floor((centerPoint. Local desiredMaterial = isDynamic and nearMaterial or materialDictionary Return linePoint + lineDirection * distance Local distance = ((planePoint - linePoint): Dot(planeNormal)) / denominator Local denominator = lineDirection: Dot(planeNormal) unit -this code is for 45 degree plane lockingįunction lineToPlaneIntersection( linePoint, lineDirection, planePoint, planeNormal) Return Vector3.new(0, 0, cameraLookVector.z / absz) ]] Return Vector3.new(cameraLookVector.x / absx, 0, 0) Return Vector3.new(0, cameraLookVector.y / absy, 0) Hope this helps.If neighbor = absx and absy >= absz then -preference towards y axis planes Under the hood, this is just doing some simple linear algebra to convert the 3 values from the starting point to the end. by now the color should be close to the target color, ensure it is done TestBrick.Color = startingColor:lerp(targetColor, i) Local stepAmt = 1.0 / (timeToComplete * framesPerSecond) make a loop to change the color, lerp() expects a number between 0 - 1. Local testBrick = Instance.new("Part", game.workspace) Local targetColor = omRGB(100, 255, 100) - bright green local startingColor = omRGB(50, 0, 0) - dark red So if you want to get from Dark Red (50, 0, 0) to Bright Green (100, 255, 100) over 5 seconds you can use Color3:lerp(Color3 targetColor, number alpha). There is a constructor to easily convert an RGB color into a Color3 with omRGB(number r, number g, number b). You can construct a color in Roblox by using a Color3. The first number represents "how much" red is in the color, second for green, and the third for blue. These values represent a color's RGB value. Colors can be represented by a combination of 3 values, each ranging from 0-255.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |