Jump to content

Recommended Posts

Posted

Hello,

 

Someone explain to me why this code does not work completely?

 

function class:CreateObject(model)
local object=self.super:CreateObject(model) 
local timer1 = 0
local ani = AnimStart 


local source1 = CreateSource(sound1)

function object:SetKey( key, value )
		--Notify(key , " - " ,s value)
		if key=='animationseq' then
			v=tonumber(value)
			if v>=0 and v <=15 then
				AnimationSeq=v
				AnimStartNext = AnimationStart[v] 
				AnimEndNext   = AnimationEnd[v]  
				--Notify(AnimStartNext)
				--Notify(AnimEndNext)
			else
				Notify("Valeur animation 0-15")
			end
		end

		if key=='animationspeed' then
			v=tonumber(value)
			if v>=0.01 and v <=3 then
				AnimationSpeed = v 
			else
				Notify("Valeur pous animation Speed 0.01-3")
			end
		end
end

.....

 

 

To be more precise it works, but I feel that the function does its ancestor called over the scene.

 

When I fontion SetKey how everything returns to normal but if the property but not much changed in the basseclass.

 

 

PS: LUA code is associated with a 3D object gift I wish I could change some properties.

 

Gabriel

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...