ImportPlayerMesh: Difference between revisions

From Onset Developer Wiki
Created page with "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.co..."
 
No edit summary
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
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.
See this page on how to get started with [[Modding]] in Onset.
 
This video shows how to import a player model mesh in Onset. It works for clothing items as well. The only requirement is that your mesh must be assigned the '''UE4_Mannequin_Skeleton''' which is part of the Modding SDK.


https://www.youtube.com/watch?v=nM8FQLYzX-c
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.
You can then assign the player mesh model to a player or NPC like this:


<syntaxhighlight lang='Lua'>
<syntaxhighlight lang='Lua'>
function OnPackageStart()
function OnPackageStart()
LoadPak("CharMod", "/CharMod/", "../../../OnsetModding/Plugins/CharMod/Content/")
LoadPak("CharMod")
end
end
AddEvent("OnPackageStart", OnPackageStart)
AddEvent("OnPackageStart", OnPackageStart)
Line 11: Line 17:
AddEvent("OnKeyPress", function(k)
AddEvent("OnKeyPress", function(k)
if k == "1" then
if k == "1" then
    local SkeletalMeshComponent = GetPlayerSkeletalMeshComponent(GetPlayerId(), "Body")
local SkeletalMeshComponent = GetPlayerSkeletalMeshComponent(GetPlayerId(), "Body")
    SkeletalMeshComponent:SetSkeletalMesh(USkeletalMesh.LoadFromAsset("/CharMod/SK_Mannequin"))
SkeletalMeshComponent:SetSkeletalMesh(USkeletalMesh.LoadFromAsset("/CharMod/SK_Mannequin"))
     end
     end
end)
end)
</syntaxhighlight>
</syntaxhighlight>
For more information on player meshes and clothing see these two pages.
* [[Clothing]]
* [[ClothingExample]]

Latest revision as of 09:26, 30 April 2021

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

This video shows how to import a player model mesh in Onset. It works for clothing items as well. The only requirement is that your mesh must be assigned the UE4_Mannequin_Skeleton which is part of the Modding SDK.

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.

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

function OnPackageStart()
	LoadPak("CharMod")
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.