Game Development Community

Decals from scripts

by Kevin Reay · in Torque Game Engine · 02/02/2003 (1:10 pm) · 2 replies

Hey,

I've got another question for all you torque experts. Can I create a decalmanager/decal from script. I found a resouce that explains how to modify the projectile (engine) code to allow it to add a decal where it hits but I'm looking for code to do this (add a decal) from scripting, so I can decide when/where to put the decal.

Any ideas?

Thanks,
Kevin

#1
02/03/2003 (4:53 pm)
Anyone?
#2
02/03/2003 (10:35 pm)
Guess you could make "applyDecal()" (or whatever it's called) in decalManager.cc to a ConsoleFunction...
then, you could call it e.g. in the "onCollision()" script function of the object that was hit and feed it with the hit position (not sure if you get the hit normal there, also... hm - but I guess you could calculate everything from the origin of the projectile, the rotation of the object and the position of the "hit")...