RE-scaling a character
by Jonas · in Torque 3D Professional · 06/08/2011 (8:00 am) · 3 replies
Heyo!
This is porbably one of the easier questions you will ever hear but here goes:
How do i go about rescaling a chracter? and i dont mean placing a chracter in the world
and using the simple Scale functionality, what i mean is the chracter object that gets spawned
as a player.
I have checked around and tried various solutions but i have yet to get it to work.
I also observe that all the character/weapons in the basic T3D build are correct size from the
beginning.
any help at all is appreciated.
Best regards
Jonas
This is porbably one of the easier questions you will ever hear but here goes:
How do i go about rescaling a chracter? and i dont mean placing a chracter in the world
and using the simple Scale functionality, what i mean is the chracter object that gets spawned
as a player.
I have checked around and tried various solutions but i have yet to get it to work.
I also observe that all the character/weapons in the basic T3D build are correct size from the
beginning.
any help at all is appreciated.
Best regards
Jonas
About the author
Freelance 3D artist at day scripter/coder on Enduring Life at night. Lover of all things TorqueScript.
#2
function Armor::onAdd(%this, %obj)
{
%obj.setscale("0.5 0.5 0.5");
}
And it works as intended, but it seems i cant apply the same logic to weapons. I have tested around a bit with the same concept of using the Classname (in the players case: className = Armor;) i figured using the Classname for weapons would be a good idea using: className = "WeaponImage"; i could scale down all in one command in the weapon.cs file.
But so far i haven't gotten it to work, Is it something im missing or do i simply need to do it another way?
Best regards
Jonas
06/11/2011 (6:33 am)
Thanks! i tested it with my character under this way:function Armor::onAdd(%this, %obj)
{
%obj.setscale("0.5 0.5 0.5");
}
And it works as intended, but it seems i cant apply the same logic to weapons. I have tested around a bit with the same concept of using the Classname (in the players case: className = Armor;) i figured using the Classname for weapons would be a good idea using: className = "WeaponImage"; i could scale down all in one command in the weapon.cs file.
But so far i haven't gotten it to work, Is it something im missing or do i simply need to do it another way?
Best regards
Jonas
Associate Michael Hall
Distracted...
You can use setScale(x y z) scriptside, usually in an onAdd() callback or you can adjust the scale property of an object as it is instantiated.