How to run different scripts depending on the platform (PC or mobile)?

Hello, everything is in the title.
In my game, I have scripts that can have problems depending on the platform.
So I was wondering, is it possible to run a script depending on the platform?
Thanks : )

I found this post, that covers this topic:
Best method of detecting the player’s platform

It seems the best way is to check the users initial input mode, and run scripts depending on that.

Alternatively, the post also has this solution, but it’s not very reliable to use:

function getPlatform()

    if (GS:IsTenFootInterface()) then
        return "Console"
    elseif (UIS.TouchEnabled and not UIS.MouseEnabled) then
        return "Mobile"
    else
        return "Desktop"
    end
end
2 Likes

thanks you so much ! Im going to see it

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.