Jump to content

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
		--***begin
		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)			
			end	
			--returning sorted by priority actions
			return self:SortActionList(actions, target)		
		end	
		--***end
	end)
end)

 

 

ds.png

Edited by Amalleus
Added comments to code
Link to comment
https://forums.kleientertainment.com/forums/topic/74931-custom-action/
Share on other sites

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