ImportPlayerMesh

From Onset Developer Wiki
Revision as of 09:20, 14 April 2020 by BlueMountains (talk | contribs)

See this page on how to get started with Modding in Onset.

This video shows how to import player model meshes in Onset. It works for clothing items as well. The mesh must be assigned the UE4_Mannequin_Skeleton.

https://www.youtube.com/watch?v=nM8FQLYzX-c

You will end up with the .pak file that contains the player mesh. Upload the .pak file to your server and add it to your package.json. For demonstration purposes you can download the above example pak file from here: https://dev.playonset.com/CharMod.pak

You can then assign the player mesh model to a player or NPC like this:

function OnPackageStart()
	LoadPak("CharMod", "/CharMod/", "../../../OnsetModding/Plugins/CharMod/Content/")
end
AddEvent("OnPackageStart", OnPackageStart)

AddEvent("OnKeyPress", function(k)
	if k == "1" then
		    local SkeletalMeshComponent = GetPlayerSkeletalMeshComponent(GetPlayerId(), "Body")
		    SkeletalMeshComponent:SetSkeletalMesh(USkeletalMesh.LoadFromAsset("/CharMod/SK_Mannequin"))
    end
end)

For more information on player meshes and clothing see these two pages.