Jump to content

Recommended Posts

Hello, I have a question :).

So, my question is, is there a way to resize the effect "inst.components.freezable:SpawnShatterFX()" gives off?

Can someone tell me if this would be possible or not? Thanks you very much for reading my question :D!!!

Edited by SuperDavid
7 minutes ago, SuperDavid said:

Every number that goes higher makes it bigger, right?

This function only works for 1, 2, 3, 4, 5.

Those numbers alter the animation picked for the FX. So the bigger the number (up to 5), the bigger the animation.

Try those numbers out, and if you aren't satisfied, I can look into hooking into SpawnShatterFX to grab the FX and increase its scale manually.

17 minutes ago, DarkXero said:

This function only works for 1, 2, 3, 4, 5.

Those numbers alter the animation picked for the FX. So the bigger the number (up to 5), the bigger the animation.

Try those numbers out, and if you aren't satisfied, I can look into hooking into SpawnShatterFX to grab the FX and increase its scale manually.

I tried all the numbers for my event but they're all are huge compared to my character :shock:! I kinda want the fx to be a little bigger than my character not much bigger!

inst:ListenForEvent("attacked", function(inst, data)
if inst.gelid_mode == true then
inst.components.freezable:SpawnShatterFX(1)
end
end)

It would really be a great help if you could help because i'm not really smart :?... Thank you so much for your help DarkXero :D!!!!!!!!

Edited by SuperDavid

Alright, then do it like this:

local function SpawnCustomShatter(inst, fxlevel, scale)
	local fx = SpawnPrefab("shatter")
	if fx ~= nil then
		fx.entity:AddFollower()
		fx.Follower:FollowSymbol(inst.GUID, "torso", 0, 0, 0)
		if fx.components.shatterfx ~= nil then
			fx.components.shatterfx:SetLevel(fxlevel)
		end
		fx.Transform:SetScale(scale, scale, scale)
	end
end

inst:ListenForEvent("attacked", function(inst, data)
	if inst.gelid_mode == true then
		SpawnCustomShatter(inst, 1, 2)
	end
end)

fxlevel is 1, 2, 3, 4, 5. Like before.

scale can be 0, 1, 2, 1.5, 0.234, 0.7, 3.999. Any number to scale the fx.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...