Code Assist Beta: AI powered code completion

Its down at the moment. (as I mentioned a bit ago.)

1 Like

I was in the same place, it requires perfect wording and order in the request. You must have at least 4-5 line of code written before it will even try. So if you want something out-of-the-blue just add some random part creation code at the top of your script, or just define a few local variables and it will start listening to your comments.

I have noticed also, that it will try to complete your comments as a suggestion of what you are trying to achieve. It did this for me and I learned a couple of new key words to prompt it to generate. Itā€™s awesome!

2 Likes

Doesnā€™t work for me, I just tried it on a script with 10+ lines with everything commented. No AI completions were generated. I think their server is erroring or is down atm.

2 Likes

I thought that, I reached the point of searching google and the DevForum for similar experiences. Clearly defined comments will instantly generate a code body for you.

If you are typing code out and reach a point where you are trying to concatenate values into a vector and reposition a part (letā€™s say), as soon as I typed part.Position = on the next line it automatically read the code above and got the idea of what I was trying to do, and it was correct. You just press tab and continue coding without those annoying calculations that usually stop the flow of creativity.

I am knocked off my feet by it to be honest, it is a staggering achievement for Roblox and anyone else that will ever use it!

5 Likes

This is literally replacing chatGPT on Roblox. Thanks! Itā€™s going to be very useful for my LUA learning.

3 Likes

Weā€™re looking at ways to improve this, but for now Iā€™d suggest that you can steer the model with hints in comments, e.g.

-- use GetPartBoundsInBox
5 Likes

Hey @Malte0621 10+ lines may not be enough unless at least a few of those lines are code. Let us know if this doesnā€™t trigger a completion?

local Part sun = script.Parent
local Part earth = sun.Earth
local distance = (earth.Position - sun.Position).Magnitude


-- make the earth circle the sun around the y axis every 20 seconds
-- maintain the current distance between the earth and sun
-- update the rotation every 1/60s
local function orbitEarth()
2 Likes

@killeralfi you need at least some code in the script to get a completion ā€“ let us know if this doesnā€™t work?

local Part sun = script.Parent
local Part earth = sun.Earth
local distance = (earth.Position - sun.Position).Magnitude


-- make the earth circle the sun around the y axis every 20 seconds
-- maintain the current distance between the earth and sun
-- update the rotation every 1/60s
local function orbitEarth()
1 Like

This feature is great but I have a bug. I enabled the feature through file>Beta features and enable AI-Powered code Completion. I never got the legal disclaimer and it doesnā€™t seem to work. I have restarted My computer, Uninstalled and installed Roblox Studio, I turned it off and on many times and still nothing. Automatically I get nothing and manually when I click Alt + \ it doesnā€™t do anything - I looked at the short cut and it says Alt + \ . Any ideas on how I could fix this?

3 Likes

@MineJulRBX you can change the shortcut, itā€™s under File ā†’ Advanced ā†’ Customize Shortcuts ā†’ Invoke AI-assisted scripting.

3 Likes

This is fairly good for being in beta! It did things I didnā€™t even expect it to. But even so, it did have its problems, like making a grid is challenging for it. But overall itā€™s pretty cool to have.

3 Likes

So, I had the AI build a character modelā€¦


It couldā€™ve gone better.


Iā€™m using positional values instead of CFrame, and it does quite better:

--create part function:
function createpart(position, size)
	local part = Instance.new("Part")
	part.Position = position
	part.Anchored = true
	part.Size = size
	part.Parent = workspace
	return part
end

--create a character function:
function createcharacter(position)
	local character = Instance.new("Model")
	character.Name = "Character"
	character.Parent = workspace
	--create the head:
	local head = Instance.new("Part")
	head.Size = Vector3.new(1, 1, 1)
	head.Position = position + Vector3.new(0, 2.5, 0)
	head.Anchored = true
	head.Parent = character
	--create the torso:
	local torso = Instance.new("Part")
	torso.Size = Vector3.new(2, 2, 1)
	torso.Position = position + Vector3.new(0, 1.5, 0)
	torso.Anchored = true
	torso.Parent= character
	--create the left and right arms:
	local leftarm = Instance.new("Part")
	leftarm.Size = Vector3.new(1, 2, 1)
	leftarm.Position = position + Vector3.new(-1.5, 0.5, 0)
	leftarm.Anchored = true
	leftarm.Parent= character
	local rightarm = Instance.new("Part")
	rightarm.Size = Vector3.new(1, 2, 1)
	rightarm.Position = position + Vector3.new(1.5, 0.5, 0)
	rightarm.Anchored = true
	rightarm.Parent= character
	--create the left and right legs:
	local leftleg = Instance.new("Part")
	leftleg.Size = Vector3.new(1, 2, 1)
	leftleg.Position = position + Vector3.new(-0.75,-0.5 ,0 )
	leftleg.Anchored=true
	leftleg.Parent=character
	local rightleg=Instance.new("Part")
	rightleg.Size=Vector3.new(1 ,2 ,1 )
	rightleg.Position=position+Vector3 .new (0.75 ,-0.5 ,0 )
	rightleg.Anchored=true 
	rightleg.Parent=character 
end

createcharacter(Vector3.zero)

--create a character using the createpart function:
function createcharacter2(position)
	local character = Instance.new("Model")
	character.Name = "Character"
	character.Parent = workspace
	--create the head:
	local head = createpart(position + Vector3.new(0, 2.5, 0), Vector3.new(1, 1, 1))
	head.Parent=character
	--create the torso:
	local torso=createpart (position+Vector3 .new (0 ,1.5 ,0 ),Vector3 .new (2 ,2 ,1 ))
	torso.Parent=character 
	--create the left and right arms:
	local leftarm=createpart (position+Vector3 .new (-1.5 ,0.5 ,0 ),Vector3 .new (1 ,2 ,1 ))
	leftarm.Parent=character 
	local rightarm=createpart (position+Vector3 .new (1.5 ,0.5 ,0 ),Vector3 .new (1 ,2 ,1 ))
	rightarm.Parent=character 
	--create the left and right legs:
	local leftleg=createpart(position + Vector3.new(-0.75,-0.5, 0), Vector3.new(1, 2, 1))
	leftleg.Parent=character
	local rightleg=createpart (position+Vector3 .new (0.75 ,-0.5 ,0 ),Vector3 .new (1 ,2 ,1 ))
	rightleg.Parent=character 
end

createcharacter2(Vector3.zAxis*2)

image
A builder AI would be more suitable for the job, but this is not bad.

1 Like

Please not a Builder AI, building is one of the funniest things on Roblox, if an AI will do it for me than its better I start learning C++ā€¢ā€¦

2 Likes

It will assist you with your current builds, just like this one. Thatā€™s only if it exists though.

1 Like

Try adding a few lines of code.

3 Likes

What do you mean?
I donā€™t see how it would do it without you asking it

this is unbelievably useful, i have no idea how you guys managed to make this but i am so happy to use this

1 Like

Itā€™s cool and all, but now Iā€™m uselessā€¦

4 Likes

Looks better than what we saw earlier,

but isnā€™t :connect() deprecated?

Yes, but I donā€™t remember the update thread.

Iā€™ve found the AI is more efficient and gives better answers when told the exact methods and ways to execute them.

4 Likes