Jump to content

Custom Action


Recommended Posts

Hello forum!

I am about to end some animation which will allow me to shoot with projectiles when i have no item in hand slot equipped. I added "animation" of how this action will look like but after i want to assign it to my rightclick the things goes weird. After loading into world i can't actually move and do any actions and when some birds/butterflyes/rabbit comes in my screen they got freeze animation after some time.

For adding function of using this action i used next code. Between ***begin and ***end code got stucked and i got that problem. Could you tell me what am i doing wrong? Screenshot of "freeze" included.

AddPrefabPostInit("wilson", function(inst)	
	inst:DoTaskInTime(0, function()		
		--there we have playeractionpicker instance
		local self = inst.components.playeractionpicker	
		--trying to assign action to right click
		self.rightclickoverride = function(inst, target, position)	
			local actions = {}			
			--we castingfire (our projectile) to target
			if target and target.replica.health and not (inst == target) then			
				table.insert(actions, CASTFIRE)			
			--returning sorted by priority actions
			return self:SortActionList(actions, target)		




Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

  • Create New...