. . . Posted June 10, 2016 Share Posted June 10, 2016 (edited) 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 August 20, 2016 by SuperDavid Link to comment https://forums.kleientertainment.com/forums/topic/68055-solved-how-to-set-size-of-prefab-like-impact/ Share on other sites More sharing options...
Aquaterion Posted June 10, 2016 Share Posted June 10, 2016 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) Link to comment https://forums.kleientertainment.com/forums/topic/68055-solved-how-to-set-size-of-prefab-like-impact/#findComment-781879 Share on other sites More sharing options...
. . . Posted June 10, 2016 Author Share Posted June 10, 2016 Thanks a lot Aquaterion !!! Link to comment https://forums.kleientertainment.com/forums/topic/68055-solved-how-to-set-size-of-prefab-like-impact/#findComment-781974 Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now