Is there a way to make scripts work inside Viewport frames

I wanted to make a character that walks randomly. It works inside Workspace but when I put the character inside a Viewport frame the script doesn’t work
It probably is not the script itself but the fact that scripts don’t run inside viewport frames (i don’t know)

Animations will not play unless there is a world object inside the viewport.

Try printing from the script to see if the script is running. If nothing prints then you will have to put the script somewhere else, and just reference the model normally.

I meant that the walking doesn’t work
the character just stays in place

It printed what I told it to print

By “walking” do you mean that you’re changing the Cframe/position or do you mean playing a walking animation?

I do not want animations I just want a character to walk. I am using Humanoid:MoveTo and it does not work inside a ViewPort Frame yet it does in Workspace.