Jump to content

Recommended Posts

Hello, I need some help. So when my character is hit on a certain event he will spawn these prefabs

local x, y, z = inst.Transform:GetWorldPosition()
SpawnPrefab("impact").Transform:SetPosition(x, y, z)
SpawnPrefab("splash_snow_fx").Transform:SetPosition(x, y, z)

now the problem is I want to make the prefab "splash_snow_fx" smaller while making "impact" larger I went through the whip.lua prefab & saw this

---

local snap = SpawnPrefab("impact")

local x, y, z = inst.Transform:GetWorldPosition()
local x1, y1, z1 = target.Transform:GetWorldPosition()
local angle = -math.atan2(z1 - z, x1 - x)
snap.Transform:SetPosition(x1, y1, z1)
snap.Transform:SetRotation(angle * RADIANS)

snap.Transform:SetScale(3, 3, 3)

---

can someone maybe tell me how I can do this or if it's even possible, thanks :)!!!

Edited by SuperDavid
local x, y, z = inst.Transform:GetWorldPosition()
local impactfx = SpawnPrefab("impact")
local snowfx = SpawnPrefab("splash_snow_fx")

impactfx.Transform:SetPosition(x, y, z)
impactfx.Transform:SetScale(2,2,2)

snowfx.Transform:SetPosition(x, y, z) 
snowfx.Transform:SetScale(.5,.5,.5)

 

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...