Jump to content

Recommended Posts

Hello!

Quick question about inst.Transform:SetScale()

Does is completely overwrites given run/walkspeed? I use the SetScale coding in most of my character mods with a 1.1x or a 1.2x scaling (because Extented Sample's models are quite small). I have a hard time making my characters have normal Wilson speed with this coding. It seems like it ignores inst.components.locomotor.walkspeed and inst.components.locomotor.runspeed.

Help my poor soul :(

Thanks in advance!

 

Edited by BillTheCipher

There are 2 types of SetScale:

  1. AnimState doesn't affect movement speed, scales in x/y, and is what you should be using.
  2. Transform which does affect movement speed and scales in 3 Dimensions, as it directly affects mobility I am only assuming there is some affect on the physics as I cannot find any reference of Scale in locomotor.
  • Like 1

My character in my own mod is only 0.85 scaled, so I compensated by setting an EXTERNAL speed modifier of 1 divided by my scale, in my case, 1 / 0.85. That works for me to get Wilson speed, I'll clarify later on how to do this if you need more help.

Edit: I didn't see IronHunter's post, I don't know how to scale using AnimState, but he says it's better so you should probably figure out how to do that.

Edited by TheSkylarr

@IronHunter, @TheSkylarr Thanks for the tips!

If anyone has more insight about this AnimState strategy on the tip of their tounge, I would gladly take it.

Quote

My character in my own mod is only 0.85 scaled, so I compensated by setting an EXTERNAL speed modifier of 1 divided by my scale, in my case, 1 / 0.85. That works for me to get Wilson speed, I'll clarify later on how to do this if you need more help.

May I ask for a quick little example about this? :flustered:

16 minutes ago, BillTheCipher said:

@IronHunter, @TheSkylarr Thanks for the tips!

If anyone has more insight about this AnimState strategy on the tip of their tounge, I would gladly take it.

May I ask for a quick little example about this? :flustered:

Its the same way you do transform
instead of inst.Transform:SetScale(x,y,z) its inst.AnimState:SetScale(x,y)

  • Like 2
48 minutes ago, BillTheCipher said:

May I ask for a quick little example about this? :flustered:

I'll give it, but I would recommend using the Animstate:SetScale instead, so you can avoid this completely.

This is an example of how I'm doing it at the moment.

local CScale = inst.transform:GetScale()
inst.components.locomotor:SetExternalSpeedMultiplier(inst, "transform_speed_correction", 1 / CScale)

I put this in my onbecomehuman code, as that seems to be all it needs to work, however I once again recommend you use Animstate instead of transform.

  • Like 1

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